[Bug c++/92642] Enhance shift-count-overflow output

2019-11-26 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92642 --- Comment #5 from Andrew Pinski --- (In reply to Jonny Grant from comment #4) > This test case for similar does have a nice warning. > > Interestingly, G++ does not indicate that 5147483647 is already 34 bits long: > 1001100101101010111011

[Bug c++/92642] Enhance shift-count-overflow output

2019-11-26 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92642 --- Comment #4 from Jonny Grant --- This test case for similar does have a nice warning. Interestingly, G++ does not indicate that 5147483647 is already 34 bits long: 100110010110101011101 which is more than an 'int' (32bit) which as

[Bug c++/92642] Enhance shift-count-overflow output

2019-11-25 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92642 --- Comment #3 from Jonathan Wakely --- No, not necessarily. extern const int n; // defined in another file auto i = 1 << n; void f(const int n) { auto i = 1 << n; } Not all const variables are compile-time constants.

[Bug c++/92642] Enhance shift-count-overflow output

2019-11-25 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92642 --- Comment #2 from Jonny Grant --- (In reply to Jonathan Wakely from comment #1) > (A) seems pointless in this case, it's right there in the caret diagnostic. > > The type size_t is irrelevant. > > IMO a better testcase would be: > > const in

[Bug c++/92642] Enhance shift-count-overflow output

2019-11-25 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92642 Jonathan Wakely changed: What|Removed |Added Keywords||diagnostic Status|UNCONFIR