[Bug c++/44263] missing diagnostic on questionable array sizes with -pedantic

2019-01-02 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44263

Eric Gallager  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org,
   ||nathan at gcc dot gnu.org

--- Comment #3 from Eric Gallager  ---
cc-ing c++ FE maintainers

[Bug c++/44263] missing diagnostic on questionable array sizes with -pedantic

2017-09-26 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44263

Eric Gallager  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-09-26
 CC||egallager at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Eric Gallager  ---
I get a warning for g with -pedantic:

$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic 44263.cc
44263.cc: In function ‘void foo()’:
44263.cc:12:39: warning: size of array is not an integral constant-expression
[-Wpedantic]
  char g[(char *) &((struct S *) 0)->b - (char *) 0];
 ~~^~~~
$

But I'm assuming you're still requesting another warning for h? Confirmed in
that case.

[Bug c++/44263] missing diagnostic on questionable array sizes with -pedantic

2011-09-28 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44263

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 CC|gcc-bugs at gcc dot gnu.org |paolo.carlini at oracle dot
   ||com

--- Comment #1 from Paolo Carlini paolo.carlini at oracle dot com 2011-09-28 
22:34:17 UTC ---
Uhm, when compute_array_index_type is called, size is always an INTEGER_CST.
For the record ICC also accepts this in strict mode and without warnings.