[clang] [clang] Add break/continue stmts with missing lable to the AST (PR #168332)

via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 17 04:39:16 PST 2025


https://github.com/Sirraide commented:

Can you add some more tests:
```c++
constexpr int f13() {
  a: break aa;
  return 1;
}

static_assert(f13() == 1);

constexpr int f14() {
  for (;;) { a: break aa; }
  return 1;
}

static_assert(f14() == 1);

constexpr int f15() {
  a: switch (1) {
    case 1: break aa;
  }
  return 1;
}

static_assert(f15() == 1);

constexpr int f16() {
  a: for (;;) {
    for (;;) break aa;
  }
  return 1;
}

static_assert(f16() == 1);
```

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


More information about the cfe-commits mailing list