[clang] [Clang] [C++26] Expansion Statements (Part 1: AST) (PR #169680)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 16 15:51:55 PDT 2026


================
@@ -5554,6 +5554,52 @@ class CXXReflectExpr : public Expr {
   }
 };
 
+/// Helper that selects an expression from an InitListExpr depending
+/// on the current expansion index.
+///
+/// \see CXXExpansionStmtPattern
+class CXXExpansionSelectExpr : public Expr {
+  friend class ASTStmtReader;
+
+  enum SubExpr { RANGE, INDEX, COUNT };
----------------
shafik wrote:

INDEX here feels a little abstract but maybe later comments will help.

Ok looks like this is covered in `CXXExpansionStmtPattern` comment, maybe a forward reference would be helpful, "if you want to know more see ...."

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


More information about the cfe-commits mailing list