0

clang-tidy: turn on SafeMode for modernize-use-transparent-functors

It seems this lint tries to be aggressive about folks not specifying `T`
in e.g., `std::less<T>`. This aggressiveness is known to not always be
correct. Clamp down on it a bit, since the suggestions this check makes
with SafeMode=0 can lead to both build breakages and unintended
functionality changes.

Bug: 1342136, 1343915
Change-Id: Ibc41ee6dafde9d548925a2d6957686ca7de4633a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3761165
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Auto-Submit: George Burgess <gbiv@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1024068}
This commit is contained in:
George Burgess IV
2022-07-14 02:00:58 +00:00
committed by Chromium LUCI CQ
parent d1e5887f56
commit a01425e4ac

@ -39,6 +39,10 @@
value: ::std::basic_string;::std::basic_string_view;::base::BasicStringPiece;::absl::string_view
- key: modernize-use-default-member-init.UseAssignment
value: 1
# crbug.com/1342136, crbug.com/1343915: At times, this check makes
# suggestions that break builds. Safe mode allows us to sidestep that.
- key: modernize-use-transparent-functors.SafeMode
value: 1
# This relaxes modernize-use-emplace in some cases; we might want to make it
# more aggressive in the future. See discussion on
# https://groups.google.com/a/chromium.org/g/cxx/c/noMMTNYiM0w .