[clang-tools-extra] [clang-tidy] do not diagnose array types within implicit instantiations of a template (PR #132924)

St. Muench via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 19 04:00:43 PDT 2025


================
@@ -66,22 +89,45 @@ void AvoidCArraysCheck::registerMatchers(MatchFinder *Finder) {
                            hasParent(varDecl(isExternC())),
                            hasParent(fieldDecl(
                                hasParent(recordDecl(isExternCContext())))),
-                           hasAncestor(functionDecl(isExternC())))),
+                           hasAncestor(functionDecl(isExternC())),
+                           isWithinImplicitTemplateInstantiation())),
----------------
stmuench wrote:

True. Maybe due to an issue in AST Visitor or even AST itself which leads to template arguments of implicit instantiations not getting recognized as implicit ones?
But I am unfortunately lacking knowlege in that area. In case you have ideas how to check this, please share :)

https://github.com/llvm/llvm-project/pull/132924


More information about the cfe-commits mailing list