PR c/54355
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Aug 2012 21:45:22 +0000 (21:45 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Aug 2012 21:45:22 +0000 (21:45 +0000)
* 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

gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr54355.c [new file with mode: 0644]

index 72b5a4d..108c0d3 100644 (file)
@@ -1,3 +1,10 @@
+2012-08-24  Jakub Jelinek  <jakub@redhat.com>
+
+       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  <jakub@redhat.com>
 
        * c-tree.h (c_last_sizeof_arg): Declare.
index 7536dc5..bea9791 100644 (file)
@@ -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);
        }
     }
index e217cd5..6fa0755 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/54355
+       * gcc.dg/pr54355.c: New test.
+
 2012-08-24  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR debug/52857
diff --git a/gcc/testsuite/gcc.dg/pr54355.c b/gcc/testsuite/gcc.dg/pr54355.c
new file mode 100644 (file)
index 0000000..0a0b7fa
--- /dev/null
@@ -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" } */