[llvm-branch-commits] [clang] [Clang] [C++26] Expansion Statements (Part 6: Destructuring Expansion Statements) (PR #169685)

Corentin Jabot via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jun 1 04:58:39 PDT 2026


================
@@ -9479,7 +9479,12 @@ StmtResult TreeTransform<Derived>::TransformCXXExpansionStmtPattern(
 
     NewPattern = cast<CXXExpansionStmtPattern>(Res.get());
   } else {
-    llvm_unreachable("TODO");
+    // The only time we instantiate an expansion statement is if its expansion
+    // size is dependent (otherwise, we only instantiate the expansions and
+    // leave the underlying CXXExpansionStmtPattern as-is). Since destructuring
+    // expansion statements never have a dependent size, we should never get
+    // here.
+    llvm_unreachable("destructuring pattern should never be instantiated");
----------------
cor3ntin wrote:

tuple_size can certainly be dependent - Am i missunderstanding?

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


More information about the llvm-branch-commits mailing list