[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

Krystian Stasiowski via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 15 07:46:01 PST 2024


================
@@ -2545,10 +2545,12 @@ ASTDeclReader::VisitClassTemplateSpecializationDeclImpl(
   }
 
   // Explicit info.
-  if (TypeSourceInfo *TyInfo = readTypeSourceInfo()) {
-    auto *ExplicitInfo =
-        new (C) ClassTemplateSpecializationDecl::ExplicitSpecializationInfo;
-    ExplicitInfo->TypeAsWritten = TyInfo;
+  if (Record.readBool()) {
+    // FIXME: We don't need to allocate this if ExternLoc and TemplateKeywordLoc
----------------
sdkrystian wrote:

I am planning to address the fixme prior to landing this, so it will likely end up reading as follows:
```cpp
if (Record.readBool()) {
  // allocate explicit instantiation info and read ExternLoc and TemplateKeywordLoc
}

if (Record.readBool())
  D->setTemplateArgsAsWritten(Record.readASTTemplateArgumentListInfo());
```

https://github.com/llvm/llvm-project/pull/81642


More information about the cfe-commits mailing list