re PR c++/33492 (Broken diagnostic: 'must_not_throw_expr' not supported by dump_expr)
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 6 Mar 2009 23:52:02 +0000 (23:52 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 6 Mar 2009 23:52:02 +0000 (23:52 +0000)
/cp
2009-03-06  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/33492
* error.c (dump_expr): Don't try to print THROW_EXPRs in full.

/testsuite
2009-03-06  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/33492
* g++.dg/other/error32.C: New.

From-SVN: r144686

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/error32.C [new file with mode: 0644]

index 720663918d41f903610a466915d1b2a92adc9d14..df07da5b85123b007ebfb4432f14f93d463d02a7 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-06  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/33492
+       * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
+
 2009-03-06  Alexandre Oliva  <aoliva@redhat.com>
 
        * decl.c (record_builtin_java_type): Use canonicalized integer
index e2cb8bf0ecc5880be4517c7ed2f1e2bd7b465b02..5eb8f28b4c994fa0ae5e0bea26b547a9ed425f75 100644 (file)
@@ -1508,8 +1508,9 @@ dump_expr (tree t, int flags)
       break;
 
     case THROW_EXPR:
-      pp_cxx_identifier (cxx_pp, "throw");
-      dump_expr (TREE_OPERAND (t, 0), flags);
+      /* 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:
index c349894213c9ce12a4e6d65643a6456185259098..891bdb79a63357b5bd17fec0366d7d62820b0ec0 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-06  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/33492
+       * g++.dg/other/error32.C: New.
+
 2009-03-06  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/39360
diff --git a/gcc/testsuite/g++.dg/other/error32.C b/gcc/testsuite/g++.dg/other/error32.C
new file mode 100644 (file)
index 0000000..35c64c4
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/33492
+// { dg-options "" }
+
+void foo()
+{
+  if (throw 0) // { dg-error "could not convert .\\<throw-expression\\>. to .bool." }
+    ;
+}