The following valid code snippet causes an ICE since GCC 3.4.0: ==================================== template<int> int foo(int i) { return !( (1 && i) ? 0 : 1 ); } ==================================== bug.cc: In function 'int foo(int)': bug.cc:3: internal compiler error: in invert_truthvalue, at fold-const.c:3165 Please submit a full bug report, [etc.]
Confirmed
Subject: Bug 27801 Author: mmitchel Date: Wed May 31 20:03:12 2006 New Revision: 114278 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114278 Log: PR c++/27801 * call.c (perform_implicit_conversion): Do not actually perform conversions in templates. PR c++/26496 * call.c (resolve_args): Check for invalid uses of bound non-static member functions. * init.c (build_offset_ref): Return error_mark_node for errors. PR c++/27385 * decl.c (reshape_init): Robustify. (reshape_init_array_1): Likewise. PR c++/27801 * g++.dg/template/cond6.C: New test. PR c++/26496 * g++.dg/template/crash51.C: New test. * g++.old-deja/g++.mike/net36.C: Tweak error markers. PR c++/27385 * g++.dg/init/array20.C: New test. Added: trunk/gcc/testsuite/g++.dg/init/array20.C trunk/gcc/testsuite/g++.dg/template/cond6.C trunk/gcc/testsuite/g++.dg/template/crash51.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c trunk/gcc/cp/decl.c trunk/gcc/cp/init.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.old-deja/g++.mike/net36.C
Subject: Bug 27801 Author: mmitchel Date: Wed May 31 20:03:27 2006 New Revision: 114279 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114279 Log: PR c++/27801 * call.c (perform_implicit_conversion): Do not actually perform conversions in templates. PR c++/26496 * call.c (resolve_args): Check for invalid uses of bound non-static member functions. * init.c (build_offset_ref): Return error_mark_node for errors. PR c++/27385 * decl.c (reshape_init): Robustify. (reshape_init_array_1): Likewise. PR c++/27801 * g++.dg/template/cond6.C: New test. PR c++/26496 * g++.dg/template/crash51.C: New test. * g++.old-deja/g++.mike/net36.C: Tweak error markers. PR c++/27385 * g++.dg/init/array20.C: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/init/array20.C branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/cond6.C branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/crash51.C Modified: branches/gcc-4_1-branch/gcc/cp/call.c branches/gcc-4_1-branch/gcc/cp/decl.c branches/gcc-4_1-branch/gcc/cp/init.c branches/gcc-4_1-branch/gcc/testsuite/g++.old-deja/g++.mike/net36.C
Subject: Bug 27801 Author: mmitchel Date: Wed May 31 20:07:35 2006 New Revision: 114280 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114280 Log: PR c++/27801 * call.c (perform_implicit_conversion): Do not actually perform conversions in templates. PR c++/26496 * call.c (resolve_args): Check for invalid uses of bound non-static member functions. * init.c (build_offset_ref): Return error_mark_node for errors. PR c++/27385 * decl.c (reshape_init): Robustify. (reshape_init_array_1): Likewise. PR c++/27801 * g++.dg/template/cond6.C: New test. PR c++/26496 * g++.dg/template/crash51.C: New test. * g++.old-deja/g++.mike/net36.C: Tweak error markers. PR c++/27385 * g++.dg/init/array20.C: New test. Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed in 4.1.2, 4.2.0.
Fixed in GCC-4.1.2.