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
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
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.
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92642
Jonathan Wakely changed:
What|Removed |Added
Keywords||diagnostic
Status|UNCONFIR