This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53745] Bitshifted value (1 << 31) within enumerator class is calculated incorrectly during compilation.
- 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: Thu, 21 Jun 2012 13:36:24 +0000
- Subject: [Bug c++/53745] Bitshifted value (1 << 31) within enumerator class is calculated incorrectly during compilation.
- Auto-submitted: auto-generated
- References: <bug-53745-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53745
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-06-21 13:36:24 UTC ---
The initializer must be converted constant expression of type unsigned long, so
by my reading it's ill-formed because (1<<31) has type int and is negative so
requires a narrowing conversion to unsigned long.