[PATCH] D80753: [clang-tidy] remove duplicate fixes of alias checkers

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 29 04:18:32 PDT 2020


aaron.ballman added a comment.

In D80753#2061565 <https://reviews.llvm.org/D80753#2061565>, @njames93 wrote:

> It may be worth verifying that the fix-its are identical too, multiple versions of a check could be running with differing options resulting in different fix-its generated, in that case we should let clang-tidy disable any conflicting fixes for us.
>  Side note would it not be nicer to just group the diagnostics into one, thinking either of these ways
>
>   CHECK-MESSAGES: warning: use emplace_back instead of push_back [hicpp-use-emplace, modernize-use-emplace]
>   CHECK-MESSAGES: warning: use emplace_back instead of push_back [hicpp-use-emplace] [modernize-use-emplace]
>
> This would result in cleaner diagnostics emitted and remove the need for that note.


I think this is a nice approach. It also helps the case where a user sees a false positive diagnostic and tries to disable it in their config file. Under the removing duplicates behavior, the user would have a harder time discovering what tests to disable, but under the above approach, they'd have all the information they need up front.



================
Comment at: clang-tools-extra/test/clang-tidy/infrastructure/duplicate-fixes-of-alias-checkers.cpp:3
+
+#include <stdio.h>
+namespace std {
----------------
Daniel599 wrote:
> Eugene.Zelenko wrote:
> > cstdio. Please also separate with newline.
> I wanted to use cstdio but the test fails with 'file not found', don't know if it's specific on my host, anyway I`ll remove this include (and the printf)
<cstdio> would have been wrong anyway -- clang-tidy (like clang) tests should not include system headers (unless they're faked system header so they're consistent across build bots).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80753/new/

https://reviews.llvm.org/D80753





More information about the cfe-commits mailing list