From 8b7a9a249a63e066cff6e95db05a3158b4cc56cc Mon Sep 17 00:00:00 2001 From: Martin Uecker Date: Sat, 7 Nov 2020 00:48:33 +0100 Subject: C Parser: Implement mixing of labels and code. Implement mixing of labels and code as adopted for C2X and process some std-attributes on labels. 2020-11-06 Martin Uecker gcc/ * doc/extend.texi: Document mixing labels and code. * doc/invoke.texi: Likewise. gcc/c/ * c-parser.c (c_parser_label): Implement mixing of labels and code. (c_parser_all_labels): Likewise. gcc/testsuite/ * c-c++-common/attr-fallthrough-2.c: Update compiler flags. * c-c++-common/Wimplicit-fallthrough-20.c: Adapt test. * gcc.dg/20031223-1.c: Update compiler flags and adapt test. * gcc.dg/c11-labels-1.c: New test. * gcc.dg/c11-labels-2.c: New test. * gcc.dg/c11-labels-3.c: New test. * gcc.dg/c2x-attr-syntax-3.c: Adapt test. * gcc.dg/c2x-labels-1.c: New test. * gcc.dg/c2x-labels-2.c: New test. * gcc.dg/c2x-labels-3.c: New test. * gcc.dg/decl-9.c: Update compiler flags and add error. * gcc.dg/gomp/barrier-2.c: Update compiler flags and add warning. * gcc.dg/gomp/declare-simd-5.c: Update compiler flags and adapt test. * gcc.dg/gomp/declare-variant-2.c: Update compiler flags and add error. * gcc.dg/label-compound-stmt-1.c: Update compiler flags. * gcc.dg/parse-decl-after-label.c: Update compiler flags. --- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-20.c | 6 +++--- gcc/testsuite/c-c++-common/attr-fallthrough-2.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'gcc/testsuite/c-c++-common') diff --git a/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-20.c b/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-20.c index d37a840..810c331 100644 --- a/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-20.c +++ b/gcc/testsuite/c-c++-common/Wimplicit-fallthrough-20.c @@ -27,13 +27,13 @@ g (int i) switch (i) { case -1: - __attribute__((used)); /* { dg-warning "ignored|only attribute" } */ + __attribute__((used)); /* { dg-warning "empty declaration" } */ default: - __attribute__((used)); /* { dg-warning "ignored|only attribute" } */ + __attribute__((used)); /* { dg-warning "empty declaration" } */ case 1: return 6; case 2 ... 4: - __attribute__((used)); /* { dg-warning "ignored|only attribute" } */ + __attribute__((used)); /* { dg-warning "empty declaration" } */ case 5: return 7; } diff --git a/gcc/testsuite/c-c++-common/attr-fallthrough-2.c b/gcc/testsuite/c-c++-common/attr-fallthrough-2.c index e8659e5..be61d5e 100644 --- a/gcc/testsuite/c-c++-common/attr-fallthrough-2.c +++ b/gcc/testsuite/c-c++-common/attr-fallthrough-2.c @@ -1,6 +1,6 @@ /* PR c/7652 */ /* { dg-do compile } */ -/* { dg-options "-Wall -Wextra -Wpedantic -Wno-unused -Wno-implicit-fallthrough" } */ +/* { dg-options "-Wall -Wextra -Wno-unused -Wno-implicit-fallthrough" } */ extern void bar (int); void -- cgit v1.1