[PATCH] D24652: [clang-tidy] readability-avoid-const-params-in-decls template instantiation bugfix

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 16 05:07:08 PDT 2016


omtcyfz added inline comments.

================
Comment at: clang-tidy/readability/AvoidConstParamsInDecls.cpp:41
@@ -40,1 +40,3 @@
+                   unless(cxxMethodDecl(ofClass(cxxRecordDecl(anyOf(
+                       isLambda(), ast_matchers::isTemplateInstantiation()))))),
                    has(typeLoc(forEach(ConstParamDecl))))
----------------
malcolm.parsons wrote:
> omtcyfz wrote:
> > `ast_matchers::` is redundant here.
> You'd think so, but it didn't compile.
Ah, I see.

Also, please provide more info next time:

> it didn't compile

doesn't give anything.

For the others: the actual problem is that `llvm/tools/clang/include/clang/Basic/Specifiers.h` has `inline bool isTemplateInstantiation(TemplateSpecializationKind Kind)` function. It might make sense to change name of the AST Matcher to something else in order to prevent collision. Thoughts, suggestions?

However, this, of course, is not in scope of the current patch.


https://reviews.llvm.org/D24652





More information about the cfe-commits mailing list