[clang-tidy] Ignore matches in template instantiations (cert-dcl21-cpp)
authorAlexander Kornienko <alexfh@google.com>
Fri, 23 Nov 2018 14:30:14 +0000 (14:30 +0000)
committerAlexander Kornienko <alexfh@google.com>
Fri, 23 Nov 2018 14:30:14 +0000 (14:30 +0000)
The test fails with a local modification to
clang-tidy/ClangTidyDiagnosticConsumer.cpp to include fixes into the key when
deduplicating the warnings.

llvm-svn: 347495

clang-tools-extra/clang-tidy/cert/PostfixOperatorCheck.cpp

index 2b8dbbe..b8e84df 100644 (file)
@@ -23,7 +23,8 @@ void PostfixOperatorCheck::registerMatchers(MatchFinder *Finder) {
     return;
 
   Finder->addMatcher(functionDecl(anyOf(hasOverloadedOperatorName("++"),
-                                        hasOverloadedOperatorName("--")))
+                                        hasOverloadedOperatorName("--")),
+                                  unless(isInstantiated()))
                          .bind("decl"),
                      this);
 }