[PATCH] Handle BIND_EXPR in C diagnostics (PR c/35443)

Jakub Jelinek jakub@redhat.com
Mon Dec 8 16:15:00 GMT 2008


Hi!

This patch handles BIND_EXPR in C pretty-printer similarly to how it is handled
in C++ error.c.

Bootstrapped/regtested on x86_64-linux, ok for trunk?

2008-12-08  Jakub Jelinek  <jakub@redhat.com>

	PR c/35443
	* c-pretty-print.c (pp_c_expression): Handle BIND_EXPR.

	* gcc.dg/pr35443.c: New test.

--- gcc/c-pretty-print.c.jj	2008-12-08 14:35:20.000000000 +0100
+++ gcc/c-pretty-print.c	2008-12-08 14:35:44.000000000 +0100
@@ -2103,6 +2103,12 @@ pp_c_expression (c_pretty_printer *pp, t
       pp_postfix_expression (pp, TREE_OPERAND (e, 1));
       break;
 
+    case BIND_EXPR:
+      /* We don't yet have a way of dumping statements in a
+         human-readable format.  */
+      pp_string (pp, "({...})");
+      break;
+
     default:
       pp_unsupported_tree (pp, e);
       break;
--- gcc/testsuite/gcc.dg/pr35443.c.jj	2008-12-08 14:38:06.000000000 +0100
+++ gcc/testsuite/gcc.dg/pr35443.c	2008-12-08 14:38:53.000000000 +0100
@@ -0,0 +1,9 @@
+/* PR c/35443 */
+/* { dg-options "" } */
+/* { dg-bogus "not supported by" "" { target *-*-* } 0 } */
+
+void
+foo ()
+{
+  ({ int i; i; })();	/* { dg-error "is not a function" } */
+}


	Jakub



More information about the Gcc-patches mailing list