On 9/9/22 07:35, Andrey Zherikov wrote:

> might not compile due to many different reasons

I faced a related situation recently: My error string generation was buggy, which taught me that the compiler does not even compile the string part of 'static assert' in the 'true' case.

The following program compiles! :)

void main() {
    static assert (true, "hello" / WAT);

> Is there a way to validate static asserts in unit tests?

I added and removed '&& false' to every 'static assert' condition manually one by one. :/

Perhaps a new compiler switch can compile every 'static assert' with an automatic 'false' and dump all their text to the output.


Reply via email to