C++ PATCH for c++/80227, SFINAE and negative array size

Jason Merrill jason@redhat.com
Fri Mar 16 18:54:00 GMT 2018

In this testcase, because sizeof (T) - 5 has unsigned type, it ends up
being an extremely large number rather than a negative one.
valid_constant_size_p seems to be a useful predicate for recognizing
problematic cases; tree_int_cst_sign_bit should also work, but seems
more subtle.

While I was looking at this I also noticed that the standard has
changed to specify that array bounds are converted constant
expressions, which allows us to simplify some of the code earlier in
the function.

Tested x86_64-pc-linux-gnu, applying to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 80227.diff
Type: text/x-patch
Size: 30630 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180316/8ab97d67/attachment.bin>

More information about the Gcc-patches mailing list