================
@@ -1784,3 +1784,40 @@ const Decl &clang::adjustDeclToTemplate(const Decl &D) {
   // FIXME: Adjust alias templates?
   return D;
 }
+
+void ExplicitInstantiationDecl::anchor() {}
+
+ExplicitInstantiationDecl *ExplicitInstantiationDecl::Create(
+    ASTContext &C, DeclContext *DC, NamedDecl *Specialization,
+    SourceLocation ExternLoc, SourceLocation TemplateLoc,
+    SourceLocation TagKWLoc, NestedNameSpecifierLoc QualifierLoc,
+    const ASTTemplateArgumentListInfo *ArgsAsWritten, SourceLocation NameLoc,
+    TypeSourceInfo *TypeAsWritten, TemplateSpecializationKind TSK) {
+  return new (C, DC) ExplicitInstantiationDecl(
+      DC, Specialization, ExternLoc, TemplateLoc, TagKWLoc, QualifierLoc,
+      ArgsAsWritten, NameLoc, TypeAsWritten, TSK);
+}
+
+ExplicitInstantiationDecl *
+ExplicitInstantiationDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {
+  return new (C, ID) ExplicitInstantiationDecl(EmptyShell());
+}
+
+SourceLocation ExplicitInstantiationDecl::getEndLoc() const {
+  if (TypeAsWritten) {
+    if (auto FTL = TypeAsWritten->getTypeLoc().getAs<FunctionTypeLoc>())
+      return FTL.getRParenLoc();
+    if (TemplateArgsAsWritten)
+      return TemplateArgsAsWritten->RAngleLoc;
+    // Static data member: end at the name.
+    return NameLoc;
----------------
zwuis wrote:

Does it handle things like `int a[1];` correctly? If no, you may refer to 
`VarDecl::getSourceRange`.

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