================
@@ -11005,10 +11051,20 @@ DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
HasNoEffect))
return true;
- // FIXME: We may still want to build some representation of this
- // explicit specialization.
- if (HasNoEffect)
- return (Decl*) nullptr;
+ if (HasNoEffect) {
+ const ASTTemplateArgumentListInfo *ArgsAsWritten = nullptr;
+ if (HasExplicitTemplateArgs)
+ ArgsAsWritten =
+ ASTTemplateArgumentListInfo::Create(Context, TemplateArgs);
+ addExplicitInstantiationDecl(Context, CurContext, D.getCXXScopeSpec(),
+ Specialization, ExternLoc, TemplateLoc,
+ SourceLocation(), ArgsAsWritten,
+ D.getIdentifierLoc(), T, TSK);
+ // Don't return the EID to the Parser — doing so would trigger
+ // unrelated semantic actions (e.g. access checks via
+ // FinalizeDeclaration).
+ return (Decl *)nullptr;
----------------
zyn0217 wrote:
ditto
https://github.com/llvm/llvm-project/pull/191658
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits