[PATCH] TokenKinds: _Atomic isn't a keyword in MS mode
David Majnemer
david.majnemer at gmail.com
Tue Mar 4 13:47:44 PST 2014
Hi rnk,
This is needed to allow MSVC's <atomic> header to compile because it
uses _Atomic is a class-id.
http://llvm-reviews.chandlerc.com/D2948
Files:
include/clang/Basic/TokenKinds.def
test/SemaCXX/MicrosoftCompatibility.cpp
Index: include/clang/Basic/TokenKinds.def
===================================================================
--- include/clang/Basic/TokenKinds.def
+++ include/clang/Basic/TokenKinds.def
@@ -267,7 +267,7 @@
KEYWORD(while , KEYALL)
KEYWORD(_Alignas , KEYALL)
KEYWORD(_Alignof , KEYALL)
-KEYWORD(_Atomic , KEYALL)
+KEYWORD(_Atomic , KEYALL|KEYNOMS)
KEYWORD(_Bool , KEYNOCXX)
KEYWORD(_Complex , KEYALL)
KEYWORD(_Generic , KEYALL)
Index: test/SemaCXX/MicrosoftCompatibility.cpp
===================================================================
--- test/SemaCXX/MicrosoftCompatibility.cpp
+++ test/SemaCXX/MicrosoftCompatibility.cpp
@@ -3,6 +3,7 @@
typedef unsigned short char16_t;
typedef unsigned int char32_t;
+struct _Atomic {};
typename decltype(3) a; // expected-warning {{expected a qualified name after 'typename'}}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2948.1.patch
Type: text/x-patch
Size: 997 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140304/011a7716/attachment.bin>
More information about the cfe-commits
mailing list