[llvm-branch-commits] [clang] [Clang] [C++26] Expansion Statements (Part 5: Iterating Expansion Statements) (PR #169684)

Corentin Jabot via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu May 7 07:27:36 PDT 2026


================
@@ -242,5 +545,187 @@ Sema::ComputeExpansionSize(CXXExpansionStmtPattern *Expansion) {
         ->getRangeExpr()
         ->getNumInits();
 
+  // CWG 3131: N is the result of evaluating the expression
+  //
+  // [&] consteval {
+  //    std::ptrdiff_t result = 0;
+  //    auto b = begin-expr;
+  //    auto e = end-expr;
+  //    for (; b != e; ++b) ++result;
+  //    return result;
+  // }()
----------------
cor3ntin wrote:

Oh gosh, this is horrible - did we land consteval blocks yet? Can we avoid code duplication ?

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


More information about the llvm-branch-commits mailing list