================
@@ -443,9 +443,15 @@ struct TargetFinder {
           Outer.add(TST->getAliasedType(), Flags | Rel::Underlying);
           // Don't *traverse* the alias, which would result in traversing the
           // template of the underlying type.
-          Outer.report(
-              TST->getTemplateName().getAsTemplateDecl()->getTemplatedDecl(),
-              Flags | Rel::Alias | Rel::TemplatePattern);
+
+          // Builtin templates e.g. __make_integer_seq, __type_pack_element
+          // are such that they don't have alias *decls*. Even then, we still
+          // traverse their desugared *types* so that instantiated decls are
+          // collected.
+          if (NamedDecl *D = TST->getTemplateName()
----------------
hokein wrote:

nit: maybe write the code like below, being explicit about the builtin template 
cases.
```
const TemplateDecl *TD = TST->getTemplateName().getAsTemplateDecl();
if (isa<BuiltinTemplateDecl>(TD))
    return;
...
```

https://github.com/llvm/llvm-project/pull/78466
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to