Commit 260fda3d by Jakub Jelinek Committed by Jakub Jelinek

re PR c/35742 (Broken diagnostic: 'goto_expr' not supported by pp_c_expression)

	PR c/35742
	* c-pretty-print.c (pp_c_expression): Handle GOTO_EXPR like
	BIND_EXPR.

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

From-SVN: r143209
parent 67b846fa
2009-01-09 Jakub Jelinek <jakub@redhat.com>
PR c/35742
* c-pretty-print.c (pp_c_expression): Handle GOTO_EXPR like
BIND_EXPR.
2009-01-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 2009-01-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa.c (last_address): Change to unsigned. * pa.c (last_address): Change to unsigned.
......
/* Subroutines common to both C and C++ pretty-printers. /* Subroutines common to both C and C++ pretty-printers.
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net> Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
...@@ -2104,6 +2104,7 @@ pp_c_expression (c_pretty_printer *pp, tree e) ...@@ -2104,6 +2104,7 @@ pp_c_expression (c_pretty_printer *pp, tree e)
break; break;
case BIND_EXPR: case BIND_EXPR:
case GOTO_EXPR:
/* We don't yet have a way of dumping statements in a /* We don't yet have a way of dumping statements in a
human-readable format. */ human-readable format. */
pp_string (pp, "({...})"); pp_string (pp, "({...})");
......
2009-01-09 Jakub Jelinek <jakub@redhat.com>
PR c/35742
* gcc.dg/pr35742.c: New test.
2009-01-09 John F. Carr <jfc@mit.edu> 2009-01-09 John F. Carr <jfc@mit.edu>
PR c++/37877 PR c++/37877
......
/* PR c/35742 */
/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
/* { dg-bogus "not supported by" "" { target *-*-* } 0 } */
void
foo ()
{
for (;;)
({break;})(); /* { dg-error "is not a function" } */
for (;;)
({continue;})(); /* { dg-error "is not a function" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment