[PATCH] D120498: [AST] Test RecursiveASTVisitor's current traversal of templates.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 1 08:44:02 PST 2022


sammccall added a comment.

Thought about this some more, and talked to @hokein offline.

I want to make sure there's consensus on "desired behavior" before documenting it, to avoid too much confusion.
https://discourse.llvm.org/t/template-representation-in-ast-and-rav-with-explicit-instantiations/60606



================
Comment at: clang/unittests/Tooling/RecursiveASTVisitorTests/Templates.cpp:283
+  VisitClassTemplateSpecializationDecl
+  VisitFieldDecl
+TraverseClassTemplateSpecializationDecl
----------------
nridge wrote:
> Is this a FIXME (body is traversed is an instantiation declaration)?
Possibly - it seems like a body shouldn't even exist, right? But maybe the instantiation is performed anyway if the definition is visible, I don't really know the semantics.

If it does exist, traversing it seems wrong: this is almost certainly a double-traversal of the body if there's also an instantiation definition for the same decl.

I'll look into it...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120498



More information about the cfe-commits mailing list