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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 14 09:23:58 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
----------------
erichkeane wrote:

This serialization is not expected to be stable.  Could we just change the 'serialization' order here to be `ExternLoc/TemplateKeywordLoc/TemplateArgsList` instead?  That way we could test this 'fixme' that way (in both places!).

Also likely value to extract this whole section into its own function so the two can use the 'same' implementation here.

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


More information about the cfe-commits mailing list