]> granicus.if.org Git - clang/commitdiff
Recognize __unaligned keyword after type specifier
authorNico Rieck <nico.rieck@gmail.com>
Thu, 4 Dec 2014 23:30:25 +0000 (23:30 +0000)
committerNico Rieck <nico.rieck@gmail.com>
Thu, 4 Dec 2014 23:30:25 +0000 (23:30 +0000)
The __unaligned keyword can appear after a struct definition:

  struct foo {...} __unaligned *x;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223412 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDeclCXX.cpp
test/SemaCXX/MicrosoftExtensions.cpp

index 79ae878520b051d413a0302d7836a1b7fa1ed441..85f6303970af7daee1607d761c08d41533839ac1 100644 (file)
@@ -1095,6 +1095,7 @@ bool Parser::isValidAfterTypeSpecifier(bool CouldBeBitfield) {
   case tok::kw_volatile:        // struct foo {...} volatile  x;
   case tok::kw_restrict:        // struct foo {...} restrict  x;
   case tok::kw__Atomic:         // struct foo {...} _Atomic   x;
+  case tok::kw___unaligned:     // struct foo {...} __unaligned *x;
   // Function specifiers
   // Note, no 'explicit'. An explicit function must be either a conversion
   // operator or a constructor. Either way, it can't have a return type.
index ec3dfce52c196f35979cedb5361ba5ad09700126..57d6f0d6bef2bc0a08545e2dde225727a58439b7 100644 (file)
@@ -79,6 +79,7 @@ struct M {
 
 // __unaligned handling
 typedef char __unaligned *aligned_type;
+typedef struct UnalignedTag { int f; } __unaligned *aligned_type2;
 
 
 template<typename T> void h1(T (__stdcall M::* const )()) { }