r223412 - Recognize __unaligned keyword after type specifier
Nico Rieck
nico.rieck at gmail.com
Thu Dec 4 15:30:25 PST 2014
Author: nrieck
Date: Thu Dec 4 17:30:25 2014
New Revision: 223412
URL: http://llvm.org/viewvc/llvm-project?rev=223412&view=rev
Log:
Recognize __unaligned keyword after type specifier
The __unaligned keyword can appear after a struct definition:
struct foo {...} __unaligned *x;
Modified:
cfe/trunk/lib/Parse/ParseDeclCXX.cpp
cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp
Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=223412&r1=223411&r2=223412&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Thu Dec 4 17:30:25 2014
@@ -1095,6 +1095,7 @@ bool Parser::isValidAfterTypeSpecifier(b
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.
Modified: cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp?rev=223412&r1=223411&r2=223412&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp (original)
+++ cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp Thu Dec 4 17:30:25 2014
@@ -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 )()) { }
More information about the cfe-commits
mailing list