[Bug c++/11667] wider-than-int enums never compare equal to 0
cvs-commit at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Jul 29 01:14:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11667
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2003-07-29 01:14 -------
Subject: Bug 11667
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2003-07-29 01:14:25
Modified files:
gcc : ChangeLog c-common.c stor-layout.c tree.h
gcc/cp : ChangeLog Make-lang.in call.c class.c decl.c
pt.c rtti.c typeck.c
gcc/testsuite : ChangeLog
gcc/testsuite/g++.dg/template: overload1.C
Added files:
gcc/testsuite/g++.dg/init: enum2.C
Log message:
PR c++/11667
* c-common.c (shorten_compare): Take into account differences
between C and C++ representation for enumeration types.
* tree.h (set_min_and_max_values_for_integral_type): Declare.
* stor-layout.c (set_min_and_max_values_for_integral_type): New
function, broken out from ...
(fixup_signed_type): ... here and ...
(fixup_unsigned_type): ... here.
PR c++/11667
* call.c (standard_conversion): Allow all integral->enumeral
conversions, after marking them as bad.
* decl.c (finish_enum): Make sure that all enumerators are
properly converted to the underlying type.
(build_enumerator): Set DECL_CONTEXT for namespace-scope
enumeration types.
* pt.c (tsubst_copy): Adjust handling of CONST_DECLs accordingly.
(tsubst_enum): Tidy.
* Make-lang.in (typeck.o): Depend on convert.h.
(class.o): Likewise.
(rtti.o): Likewise.
* call.c: Include convert.h.
(convert_arg_to_ellipsis): Use convert_to_real.
* class.c: Include convert.h.
(build_base_path): Use convert_to_integer.
* rtti.c: Include convert.h.
(build_headof): Use convert_to_integer.
* typeck.c: Include convert.h.
(decay_conversion): Use convert_to_integer.
(build_unary_op): Use build_nop.
(get_delta_difference): Use convert_to_integer.
(build_ptrmemfunc): Avoid unncessary conversions.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.641&r2=2.642
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&r1=1.439&r2=1.440
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/stor-layout.c.diff?cvsroot=gcc&r1=1.164&r2=1.165
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.h.diff?cvsroot=gcc&r1=1.430&r2=1.431
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3563&r2=1.3564
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/Make-lang.in.diff?cvsroot=gcc&r1=1.158&r2=1.159
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.416&r2=1.417
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&r1=1.557&r2=1.558
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1102&r2=1.1103
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.740&r2=1.741
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/rtti.c.diff?cvsroot=gcc&r1=1.170&r2=1.171
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.487&r2=1.488
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2925&r2=1.2926
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/enum2.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/overload1.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
More information about the Gcc-bugs
mailing list