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

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu May 7 08:51:13 PDT 2026


================
@@ -20,9 +20,28 @@
 #include "clang/Sema/Overload.h"
 #include "clang/Sema/Sema.h"
 #include "clang/Sema/Template.h"
+#include "llvm/ADT/ScopeExit.h"
 
 using namespace clang;
 
+namespace {
+struct IterableExpansionStmtData {
+  enum class State {
+    NotIterable,
----------------
Sirraide wrote:

I mean, fundamentally there are 3 states here
1. This is not an iterating expansion statement; we should try destructuring instead.
2. This is iterable, but there was some error trying to build e.g. the declaration of the expansion variable.
3. This is iterable, and there is no error

I’m not sure using an optional here would make things clearer

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


More information about the llvm-branch-commits mailing list