This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49896] undefined reference to static const integral member whose address is not used, for some values of the constant
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 30 Jul 2011 12:09:54 +0000
- Subject: [Bug c++/49896] undefined reference to static const integral member whose address is not used, for some values of the constant
- Auto-submitted: auto-generated
- References: <bug-49896-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49896
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-07-30 12:09:28 UTC ---
The initializer results in integer overflow which is undefined behaviour, so if
G++ accepts it but requires the variable to be defined then that is a
reasonable result.
The modified example shouldn't cause an ICE, that's a regression, but it seems
to be fixed in 4.7 already