This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++, diagnostics] PR 33492
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: Gabriel Dos Reis <gdr at cs dot tamu dot edu>
- Date: Thu, 12 Feb 2009 17:03:06 +0100
- Subject: [C++, diagnostics] PR 33492
Hi all, hi Gaby,
I don't think we can do much better here, for now. What do you think?
Tested x86_64-linux.
Thanks,
Paolo.
//////////////////////
/cp
2009-02-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/33492
* error.c (dump_expr): Don't try to print THROW_EXPRs in full.
/testsuite
2009-02-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/33492
* g++.dg/other/error32.C: New.
Index: testsuite/g++.dg/other/error32.C
===================================================================
*** testsuite/g++.dg/other/error32.C (revision 0)
--- testsuite/g++.dg/other/error32.C (revision 0)
***************
*** 0 ****
--- 1,8 ----
+ // PR c++/33492
+ // { dg-options "" }
+
+ void foo()
+ {
+ if (throw 0) // { dg-error "could not convert .\\<throw-expression\\>. to .bool." }
+ ;
+ }
Index: cp/error.c
===================================================================
*** cp/error.c (revision 144128)
--- cp/error.c (working copy)
*************** dump_expr (tree t, int flags)
*** 1508,1515 ****
break;
case THROW_EXPR:
! pp_cxx_identifier (cxx_pp, "throw");
! dump_expr (TREE_OPERAND (t, 0), flags);
break;
case PTRMEM_CST:
--- 1508,1516 ----
break;
case THROW_EXPR:
! /* While waiting for caret diagnostics, avoid printing
! __cxa_allocate_exception, __cxa_throw, and the like. */
! pp_cxx_identifier (cxx_pp, "<throw-expression>");
break;
case PTRMEM_CST: