[Bug c++/87996] [8/9 Regression] "size of array is negative" error when SIZE_MAX/2 < sizeof(array) <= SIZE_MAX
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Nov 13 20:43:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87996
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-11-13
CC| |msebor at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
$ cat t.C && gcc -S -Wall -Wextra t.C
char array[__SIZE_MAX__];
t.C:1:24: error: size of array ‘array’ is negative
1 | char array[__SIZE_MAX__];
| ^
The change was introduced in r258604:
r258604 | jason | 2018-03-16 14:56:01 -0400 (Fri, 16 Mar 2018) | 4 lines
PR c++/80227 - SFINAE and negative array size.
* decl.c (compute_array_index_type): Use
build_converted_constant_expr and valid_constant_size_p.
More information about the Gcc-bugs
mailing list