Skip to content

Commit 89169a3

Browse files
committed
[clang-tidy] Add bugprone-inaccurate-erase check.
This will hopefully identify misusage of the erase-remove idiom. Test: "foo.erase(std::remove_if(...))" produces error. Test: mmm system/core/adb -j (no warnings) Change-Id: Iba0a6fc40cb6e7c65a7a3926d915874dc89a60c6
1 parent a22e74c commit 89169a3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

adb/Android.bp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
tidy_errors = [
16+
"-*",
17+
"bugprone-inaccurate-erase",
18+
]
19+
1520
cc_defaults {
1621
name: "adb_defaults",
1722

@@ -73,6 +78,10 @@ cc_defaults {
7378
],
7479
},
7580
},
81+
82+
tidy: true,
83+
tidy_checks: tidy_errors,
84+
tidy_checks_as_errors: tidy_errors,
7685
}
7786

7887
cc_defaults {

0 commit comments

Comments
 (0)