Bugfix for 30398. Don't warn for template instantiations
Details
- Reviewers
aaron.ballman hokein alexfh - Commits
- rG8cb9b02c7e4e: [clang-tidy] readability-avoid-const-params-in-decls template instantiation…
rCTE283873: [clang-tidy] readability-avoid-const-params-in-decls template instantiation…
rL283873: [clang-tidy] readability-avoid-const-params-in-decls template instantiation…
Diff Detail
- Repository
- rL LLVM
Event Timeline
Probably it also makes sense to reflect both lambda and template instantiation parts in documentation, since I find current wording totally confusing at the moment.
clang-tidy/readability/AvoidConstParamsInDecls.cpp | ||
---|---|---|
41 ↗ | (On Diff #71606) | ast_matchers:: is redundant here. |
clang-tidy/readability/AvoidConstParamsInDecls.cpp | ||
---|---|---|
41 ↗ | (On Diff #71606) | You'd think so, but it didn't compile. |
clang-tidy/readability/AvoidConstParamsInDecls.cpp | ||
---|---|---|
41 ↗ | (On Diff #71606) | Ah, I see. Also, please provide more info next time:
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. |
clang-tidy/readability/AvoidConstParamsInDecls.cpp | ||
---|---|---|
39 ↗ | (On Diff #71606) | Would be helpful to expand on why we're ignoring only member function of class instantiations (and not instantiations of member or free standing functions, for example). |
clang-tidy/readability/AvoidConstParamsInDecls.cpp | ||
---|---|---|
39 ↗ | (On Diff #71606) | AFAICT, template instantiations of member and free standing functions are definitions when the template is a definition. |