https://github.com/IamYJLee created 
https://github.com/llvm/llvm-project/pull/205965

The selected index of a PackIndexingType was not serialized, so on 
deserialization its canonical type was rebuilt as a dependent type, crashing 
CodeGen.

Fixes https://github.com/llvm/llvm-project/issues/204479

>From e4e0af6e75a56918530aaf31c6024de7cdb1c09a Mon Sep 17 00:00:00 2001
From: LeeYoungJoon <[email protected]>
Date: Fri, 26 Jun 2026 12:39:01 +0900
Subject: [PATCH] [clang][ast] Add an index property for PackIndexingType
 serialization

---
 clang/include/clang/AST/TypeProperties.td | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/clang/include/clang/AST/TypeProperties.td 
b/clang/include/clang/AST/TypeProperties.td
index f16c10da430f9..e2168d0a00ff4 100644
--- a/clang/include/clang/AST/TypeProperties.td
+++ b/clang/include/clang/AST/TypeProperties.td
@@ -489,9 +489,12 @@ let Class = PackIndexingType in {
   def : Property<"expansions", Array<QualType>> {
     let Read = [{ node->getExpansions() }];
   }
+  def : Property<"index", UnsignedOrNone> {
+    let Read = [{ node->getSelectedIndex() }];
+  }
 
   def : Creator<[{
-    return ctx.getPackIndexingType(pattern, indexExpression, 
isFullySubstituted, expansions);
+    return ctx.getPackIndexingType(pattern, indexExpression, 
isFullySubstituted, expansions, index);
   }]>;
 }
 

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

Reply via email to