alexfh wrote:

Just to confirm: is this the intentional outcome of this patch? 
https://gcc.godbolt.org/z/Kf9YK1qM3
```
enum {
    a = 1<<12,
    b = (-1)<<13
};
```
```
<source>:3:9: error: expression is not an integral constant expression
    3 |     b = (-1)<<13
      |         ^~~~~~~~
<source>:3:13: note: left shift of negative value -1
    3 |     b = (-1)<<13
      |             ^
```

Though technically, it's UB before C++20, the diagnostic - "expression is not 
an integral constant expression" - doesn't sound helpful (how is it not 
constant or not integral?). And what's worse, is that it's an error rather than 
a warning that can be disabled.

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

Reply via email to