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'}}
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'}}
 
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to