From: jakub Date: Fri, 24 Aug 2012 21:45:22 +0000 (+0000) Subject: PR c/54355 X-Git-Tag: upstream/4.9.2~10983 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a90d57eded734a2033a6b32722111c5799618712;p=platform%2Fupstream%2Flinaro-gcc.git PR c/54355 * c-decl.c (c_parser_label): Pass true as nested and fix up comments for nested and empty_ok arguments in the call to c_parser_declaration_or_fndef. * gcc.dg/pr54355.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190656 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 72b5a4d..108c0d3 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,10 @@ +2012-08-24 Jakub Jelinek + + PR c/54355 + * c-decl.c (c_parser_label): Pass true as nested and fix up comments + for nested and empty_ok arguments in the call to + c_parser_declaration_or_fndef. + 2012-08-17 Jakub Jelinek * c-tree.h (c_last_sizeof_arg): Declare. diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 7536dc5..bea9791 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -4327,7 +4327,7 @@ c_parser_label (c_parser *parser) "a declaration is not a statement"); c_parser_declaration_or_fndef (parser, /*fndef_ok*/ false, /*static_assert_ok*/ true, - /*nested*/ true, /*empty_ok*/ false, + /*empty_ok*/ true, /*nested*/ true, /*start_attr_ok*/ true, NULL); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e217cd5..6fa0755 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-08-24 Jakub Jelinek + + PR c/54355 + * gcc.dg/pr54355.c: New test. + 2012-08-24 H.J. Lu PR debug/52857 diff --git a/gcc/testsuite/gcc.dg/pr54355.c b/gcc/testsuite/gcc.dg/pr54355.c new file mode 100644 index 0000000..0a0b7fa --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr54355.c @@ -0,0 +1,11 @@ +/* PR c/54355 */ +/* { dg-do compile } */ + +void +foo (int i) +{ + switch (i) + { + case 0: T x > /* { dg-error "(label|unknown type|expected)" } */ + } +} /* { dg-error "expected" } */