================
@@ -10827,8 +10869,19 @@ DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
       return true;
     }
 
-    // FIXME: Create an ExplicitInstantiation node?
-    return (Decl*) nullptr;
+    {
+      const ASTTemplateArgumentListInfo *ArgsAsWritten = nullptr;
+      if (auto *VTSD = dyn_cast<VarTemplateSpecializationDecl>(Prev))
+        ArgsAsWritten = VTSD->getTemplateArgsAsWritten();
+      addExplicitInstantiationDecl(Context, CurContext, D.getCXXScopeSpec(),
+                                   D.getSourceRange().getEnd(), Prev, 
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;
+    }
----------------
mizvekov wrote:

You don't need to introduce this scope since we are at the end of the outer 
scope anyway.

https://github.com/llvm/llvm-project/pull/191658
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to