diff --git a/cc/cc_test.go b/cc/cc_test.go
index 01ac133..5d569cc 100644
--- a/cc/cc_test.go
+++ b/cc/cc_test.go
@@ -4386,93 +4386,3 @@
 		})
 	}
 }
-
-func TestCcBuildBrokenClangAsFlags(t *testing.T) {
-	tests := []struct {
-		name                    string
-		clangAsFlags            []string
-		BuildBrokenClangAsFlags bool
-		err                     string
-	}{
-		{
-			name:         "error when clang_asflags is set",
-			clangAsFlags: []string{"-a", "-b"},
-			err:          "clang_asflags: property is deprecated",
-		},
-		{
-			name:                    "no error when BuildBrokenClangAsFlags is explicitly set to true",
-			clangAsFlags:            []string{"-a", "-b"},
-			BuildBrokenClangAsFlags: true,
-		},
-	}
-
-	for _, test := range tests {
-		t.Run(test.name, func(t *testing.T) {
-			bp := fmt.Sprintf(`
-			cc_library {
-			   name: "foo",
-			   clang_asflags: %s,
-			}`, `["`+strings.Join(test.clangAsFlags, `","`)+`"]`)
-
-			if test.err == "" {
-				android.GroupFixturePreparers(
-					prepareForCcTest,
-					android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
-						if test.BuildBrokenClangAsFlags {
-							variables.BuildBrokenClangAsFlags = test.BuildBrokenClangAsFlags
-						}
-					}),
-				).RunTestWithBp(t, bp)
-			} else {
-				prepareForCcTest.
-					ExtendWithErrorHandler(android.FixtureExpectsOneErrorPattern(test.err)).
-					RunTestWithBp(t, bp)
-			}
-		})
-	}
-}
-
-func TestCcBuildBrokenClangCFlags(t *testing.T) {
-	tests := []struct {
-		name                   string
-		clangCFlags            []string
-		BuildBrokenClangCFlags bool
-		err                    string
-	}{
-		{
-			name:        "error when clang_cflags is set",
-			clangCFlags: []string{"-a", "-b"},
-			err:         "clang_cflags: property is deprecated",
-		},
-		{
-			name:                   "no error when BuildBrokenClangCFlags is explicitly set to true",
-			clangCFlags:            []string{"-a", "-b"},
-			BuildBrokenClangCFlags: true,
-		},
-	}
-
-	for _, test := range tests {
-		t.Run(test.name, func(t *testing.T) {
-			bp := fmt.Sprintf(`
-			cc_library {
-			   name: "foo",
-			   clang_cflags: %s,
-			}`, `["`+strings.Join(test.clangCFlags, `","`)+`"]`)
-
-			if test.err == "" {
-				android.GroupFixturePreparers(
-					prepareForCcTest,
-					android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
-						if test.BuildBrokenClangCFlags {
-							variables.BuildBrokenClangCFlags = test.BuildBrokenClangCFlags
-						}
-					}),
-				).RunTestWithBp(t, bp)
-			} else {
-				prepareForCcTest.
-					ExtendWithErrorHandler(android.FixtureExpectsOneErrorPattern(test.err)).
-					RunTestWithBp(t, bp)
-			}
-		})
-	}
-}
diff --git a/cc/compiler.go b/cc/compiler.go
index a751754..f9f7b6f 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -441,24 +441,12 @@
 	// TODO: debug
 	flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Release.Cflags)...)
 
-	if !ctx.DeviceConfig().BuildBrokenClangCFlags() && len(compiler.Properties.Clang_cflags) != 0 {
-		ctx.PropertyErrorf("clang_cflags", "property is deprecated, see Changes.md file")
-	} else {
-		CheckBadCompilerFlags(ctx, "clang_cflags", compiler.Properties.Clang_cflags)
-	}
-	if !ctx.DeviceConfig().BuildBrokenClangAsFlags() && len(compiler.Properties.Clang_asflags) != 0 {
-		ctx.PropertyErrorf("clang_asflags", "property is deprecated, see Changes.md file")
-	} else {
-		CheckBadCompilerFlags(ctx, "clang_asflags", compiler.Properties.Clang_asflags)
-	}
+	CheckBadCompilerFlags(ctx, "clang_cflags", compiler.Properties.Clang_cflags)
+	CheckBadCompilerFlags(ctx, "clang_asflags", compiler.Properties.Clang_asflags)
 
 	flags.Local.CFlags = config.ClangFilterUnknownCflags(flags.Local.CFlags)
-	if !ctx.DeviceConfig().BuildBrokenClangCFlags() {
-		flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Clang_cflags)...)
-	}
-	if !ctx.DeviceConfig().BuildBrokenClangAsFlags() {
-		flags.Local.AsFlags = append(flags.Local.AsFlags, esc(compiler.Properties.Clang_asflags)...)
-	}
+	flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Clang_cflags)...)
+	flags.Local.AsFlags = append(flags.Local.AsFlags, esc(compiler.Properties.Clang_asflags)...)
 	flags.Local.CppFlags = config.ClangFilterUnknownCflags(flags.Local.CppFlags)
 	flags.Local.ConlyFlags = config.ClangFilterUnknownCflags(flags.Local.ConlyFlags)
 	flags.Local.LdFlags = config.ClangFilterUnknownCflags(flags.Local.LdFlags)
