================
@@ -2196,23 +2208,23 @@ bool
RecursiveASTVisitor<Derived>::TraverseTemplateArgumentLocsHelper(
the source code anywhere. (Note the instatiated *type* --
\
set<int> -- is written, and will still get a callback of
\
TemplateSpecializationType). For explicit instantiations
\
- ("template set<int>;"), we do need a callback, since this
\
- is the only callback that's made for this instantiation.
\
- We use getTemplateArgsAsWritten() to distinguish. */
\
+ ("template set<int>;"), the ExplicitInstantiationDecl node
\
+ handles traversal of template args and qualifier.
\
+ For explicit specializations ("template<> set<int> {...};"),
\
+ we traverse template args here since there is no EID. */
\
if (const auto *ArgsWritten = D->getTemplateArgsAsWritten()) {
\
assert(D->getTemplateSpecializationKind() != TSK_ImplicitInstantiation);
\
- /* The args that remains unspecialized. */
\
- TRY_TO(TraverseTemplateArgumentLocsHelper(
\
- ArgsWritten->getTemplateArgs(), ArgsWritten->NumTemplateArgs));
\
+ if (D->getTemplateSpecializationKind() == TSK_ExplicitSpecialization) {
\
+ TRY_TO(TraverseTemplateArgumentLocsHelper(
\
+ ArgsWritten->getTemplateArgs(), ArgsWritten->NumTemplateArgs));
\
+ }
\
}
\
\
if (getDerived().shouldVisitTemplateInstantiations() ||
\
D->getTemplateSpecializationKind() == TSK_ExplicitSpecialization) {
\
/* Traverse base definition for explicit specializations */
\
TRY_TO(Traverse##DECLKIND##Helper(D));
\
} else {
\
- TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
\
-
\
----------------
zyn0217 wrote:
Why this change?
https://github.com/llvm/llvm-project/pull/191658
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits