This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/48003] [4.6 Regression] Regression in Template Constants from 4.5.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48003

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-07 13:42:37 UTC ---
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#699 added integer
overflow ("a result that is not mathematically defined or not in the range of
representable values for its type") to the list of things that cause an
expression to not be a constant expression

The non-type template argument needs to be an integral constant-expression, but
it's not a constant expression due to the overflow, so the code is invalid.

Whether it should be accepted with -fpermissive is a separate matter, as is the
quality of diagnostic.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]