This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33736] New: "error: integer constant is too large for ‘long’ type" incorrect for C++0x
- From: "lloyd at randombit dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Oct 2007 13:31:42 -0000
- Subject: [Bug c++/33736] New: "error: integer constant is too large for ‘long’ type" incorrect for C++0x
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Integer constants that don't fit into a long cause a pedwarn in GCC as of the
20070907 snapshot (this has been the behavior for a while). However this is
incorrect for C++0x which does (at least in the WG draft) allows for something
to be placed in a long long or unsigned long long if it doesn't fit into
anything smaller (section 2.13.1.2 + table 5). However GCC pedwarns even with
-std=c++0x or -std=gnu++0x
(On x86-64 or other 64-bit machines this behavior can be observed while
compiling with -m32).
$ g++-4.3-20070907 -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.3-20070907/configure --program-suffix=-4.3-20070907
--enable-language=c,c++ --prefix=/home/jack/opt --with-mpfr=/home/jack/opt
Thread model: posix
gcc version 4.3.0 20070907 (experimental) (GCC)
--
Summary: "error: integer constant is too large for ?long? type"
incorrect for C++0x
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: lloyd at randombit dot net
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33736