The C++ frontend generates a broken diagnostic for the following code snippet since GCC 3.4.0: ============================================== template<int> void foo() { delete 0 ? 1 : 0; } ============================================== bug.cc: In function 'void foo()': bug.cc:1: error: could not convert '#'dl_expr' not supported by dump_expr#<expression error>' to 'bool'
Subject: Bug 33493 Author: paolo Date: Thu Sep 27 09:20:59 2007 New Revision: 128831 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128831 Log: /cp 2007-09-27 Paolo Carlini <pcarlini@suse.de> PR c++/33493 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR. * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing spaces in the formatting. * cxx-pretty-print.h (pp_cxx_delete_expression): Declare. /testsuite 2007-09-27 Paolo Carlini <pcarlini@suse.de> PR c++/33493 * g++.dg/template/error31.C: New. Added: trunk/gcc/testsuite/g++.dg/template/error31.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cxx-pretty-print.c trunk/gcc/cp/cxx-pretty-print.h trunk/gcc/cp/error.c trunk/gcc/testsuite/ChangeLog
Fixed in mainline.
Subject: Bug 33493 Author: reichelt Date: Wed Jan 2 23:47:08 2008 New Revision: 131267 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131267 Log: Backport: 2007-09-27 Paolo Carlini <pcarlini@suse.de> PR c++/33493 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR. * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing spaces in the formatting. * cxx-pretty-print.h (pp_cxx_delete_expression): Declare. * g++.dg/template/error31.C: New. Added: branches/gcc-4_2-branch/gcc/testsuite/g++.dg/template/error31.C Modified: branches/gcc-4_2-branch/gcc/cp/ChangeLog branches/gcc-4_2-branch/gcc/cp/cxx-pretty-print.c branches/gcc-4_2-branch/gcc/cp/cxx-pretty-print.h branches/gcc-4_2-branch/gcc/cp/error.c branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
Now also fixed in gcc 4.2.3.
Closing 4.1 branch.