From: Jakub Jelinek Date: Fri, 9 Jan 2009 16:46:47 +0000 (+0100) Subject: re PR c/35742 (Broken diagnostic: 'goto_expr' not supported by pp_c_expression) X-Git-Tag: releases/gcc-4.4.0~955 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=260fda3d0a0723520eea61bae0f5b4467d33f49d;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 540424830344..dd81dbc178de 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-01-09 Jakub Jelinek + + PR c/35742 + * c-pretty-print.c (pp_c_expression): Handle GOTO_EXPR like + BIND_EXPR. + 2009-01-09 John David Anglin * pa.c (last_address): Change to unsigned. diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c index 8676205052b3..ebfb8851ccf0 100644 --- a/gcc/c-pretty-print.c +++ b/gcc/c-pretty-print.c @@ -1,5 +1,5 @@ /* 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. Contributed by Gabriel Dos Reis @@ -2104,6 +2104,7 @@ pp_c_expression (c_pretty_printer *pp, tree e) break; case BIND_EXPR: + case GOTO_EXPR: /* We don't yet have a way of dumping statements in a human-readable format. */ pp_string (pp, "({...})"); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a86c18caac4d..b59761662259 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-01-09 Jakub Jelinek + + PR c/35742 + * gcc.dg/pr35742.c: New test. + 2009-01-09 John F. Carr PR c++/37877 diff --git a/gcc/testsuite/gcc.dg/pr35742.c b/gcc/testsuite/gcc.dg/pr35742.c new file mode 100644 index 000000000000..609472792097 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr35742.c @@ -0,0 +1,13 @@ +/* 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" } */ +}