OSDN Git Service

PR c++/43680
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 May 2010 21:16:40 +0000 (21:16 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 May 2010 21:16:40 +0000 (21:16 +0000)
commitbb9c1a09933d3b672bedb16747761d478245dddc
treef66f3527bad37dd8ad2f5c0b5d0966b9ca678f5b
parent3440fb35626fc2dd251b89bb90ccb32c8ace9789
PR c++/43680
gcc:
* c.opt (-fstrict-enums): New.
* doc/invoke.texi (C++ Dialect Options): Document -fstrict-enums.
gcc/cp:
* decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
from the selected underlying type unless -fstrict-enums.  Set
ENUM_UNDERLYING_TYPE to have the restricted range.
* cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
* class.c (check_bitfield_decl): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159006 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/c.opt
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cvt.c
gcc/cp/decl.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/enum2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/warn/Wswitch-1.C
gcc/testsuite/g++.dg/warn/pr33738.C