Issue 180098
Summary Rejects-valid (?) with goto and "if constexpr"
Labels new issue
Assignees
Reporter efriedma-quic
    Testcase:

```
struct A { A(); ~A(); };
template <bool b> void g() {
  if constexpr (b) goto l;
  A a;
 l:;
}
void z() {
  g<false>();
}
```

clang rejects, gcc and MSVC accept.  The standard says "the transfer of control shall not be a jump"... a goto in a discarded statement can't actually be executed, so I guess we should ignore it?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to