https://github.com/zyn0217 commented:

So I took a stab at it.

In `ParseStaticAssertDeclaration()`, we parsed the message in unclosed 
static_assert as a constant expression rather than an unevaluated string 
literal per the logic on lines 1079-1089.

So this approach gives up building an expression for unclosed expressions, 
which works but also loses the diagnoses of the condition expression where it 
would otherwise evaluate to false:


```cpp
static_assert(false, ""
```

Prior to clang 19, with C++11 mode, we give three errors for the above code:

https://gcc.godbolt.org/z/PMPab779n
(note the last `error: static assertion failed`)

While with this patch, we no longer diagnose it. Note that even on the 
assertion-free trunk with c++26 mode, we do complain about the false 
conditions. 

I'm not sure if this is acceptable for us.

https://github.com/llvm/llvm-project/pull/108701
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to