[PATCH] D63299: [Clang] Parse GNU fallthrough attributes

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 13 14:46:57 PDT 2019


xbolva00 created this revision.
xbolva00 added reviewers: aaron.ballman, rsmith, efriedma, nickdesaulniers.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Please https://reviews.llvm.org/D63260


Repository:
  rC Clang

https://reviews.llvm.org/D63299

Files:
  lib/Parse/ParseStmt.cpp
  test/Sema/address_spaces.c
  test/Sema/block-literal.c


Index: test/Sema/block-literal.c
===================================================================
--- test/Sema/block-literal.c
+++ test/Sema/block-literal.c
@@ -41,8 +41,8 @@
 
   foo:
   takeblock(^{ x = 4; });  // expected-error {{variable is not assignable (missing __block type specifier)}}
-  __block y = 7;    // expected-warning {{type specifier missing, defaults to 'int'}}
-  takeblock(^{ y = 8; });
+  __block y = 7;    // expected-warning {{use of undeclared identifier 'y'}}
+  takeblock(^{ y = 8; }); // expected-warning {{use of undeclared identifier 'y'}}
 }
 
 
Index: test/Sema/address_spaces.c
===================================================================
--- test/Sema/address_spaces.c
+++ test/Sema/address_spaces.c
@@ -9,7 +9,7 @@
 void foo(_AS3 float *a,
          _AS1 float b) // expected-error {{parameter may not be qualified with an address space}}
 {
-  _AS2 *x;// expected-warning {{type specifier missing, defaults to 'int'}}
+  _AS2 *x;// // expected-warning {{use of undeclared identifier 'x'}}
   _AS1 float * _AS2 *B;
 
   int _AS1 _AS2 *Y;   // expected-error {{multiple address spaces specified for type}}
Index: lib/Parse/ParseStmt.cpp
===================================================================
--- lib/Parse/ParseStmt.cpp
+++ lib/Parse/ParseStmt.cpp
@@ -99,6 +99,7 @@
   ParenBraceBracketBalancer BalancerRAIIObj(*this);
 
   ParsedAttributesWithRange Attrs(AttrFactory);
+  MaybeParseGNUAttributes(Attrs);
   MaybeParseCXX11Attributes(Attrs, nullptr, /*MightBeObjCMessageSend*/ true);
   if (!MaybeParseOpenCLUnrollHintAttribute(Attrs))
     return StmtError();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63299.204632.patch
Type: text/x-patch
Size: 1620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190613/be8e6e62/attachment.bin>


More information about the cfe-commits mailing list