================
@@ -1450,3 +1450,9 @@ namespace GH149500 {
unsigned int * p = &(*(unsigned int *)0x400);
static const void *q = &(*(const struct sysrq_key_op *)0);
}
+
+constexpr bool missingCase() {
+ switch (1) {
+ 1u: return false; // expected-error {{expected 'case' keyword before
expression}}
----------------
tbaederr wrote:
It's not about the diagnostic, it's about clang crashing in constant evaluation
because the type of the case stmt expression is wrong:
https://github.com/llvm/llvm-project/issues/165555 (the second example further
down).
I don't know if the conversions only need to happen for well-formed code or
not. If not, we should instead mark the case stmt as having errors I guess, but
just letting it through like that trips up a couple of places
https://github.com/llvm/llvm-project/pull/166326
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits