[PATCH] D121412: Complete the list of single-underscore keywords for MSVC compat.
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 10 13:57:42 PST 2022
efriedma created this revision.
efriedma added reviewers: rnk, mstorsjo.
Herald added a subscriber: dexonsmith.
Herald added a project: All.
efriedma requested review of this revision.
Herald added a project: clang.
List derived from https://docs.microsoft.com/en-us/cpp/cpp/keywords-cpp . Not that this is something we really want to encourage, but some of these show up in practice, so I figured I should just complete the list.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D121412
Files:
clang/include/clang/Basic/TokenKinds.def
Index: clang/include/clang/Basic/TokenKinds.def
===================================================================
--- clang/include/clang/Basic/TokenKinds.def
+++ clang/include/clang/Basic/TokenKinds.def
@@ -676,24 +676,40 @@
KEYWORD(__virtual_inheritance , KEYMS)
KEYWORD(__interface , KEYMS)
ALIAS("__int8" , char , KEYMS)
-ALIAS("_int8" , char , KEYMS)
ALIAS("__int16" , short , KEYMS)
-ALIAS("_int16" , short , KEYMS)
ALIAS("__int32" , int , KEYMS)
-ALIAS("_int32" , int , KEYMS)
-ALIAS("_int64" , __int64 , KEYMS)
ALIAS("__wchar_t" , wchar_t , KEYMS)
-ALIAS("_asm" , asm , KEYMS)
-ALIAS("_alignof" , __alignof , KEYMS)
ALIAS("__builtin_alignof", __alignof , KEYMS)
-ALIAS("_cdecl" , __cdecl , KEYMS | KEYBORLAND)
-ALIAS("_fastcall" , __fastcall , KEYMS | KEYBORLAND)
-ALIAS("_stdcall" , __stdcall , KEYMS | KEYBORLAND)
-ALIAS("_thiscall" , __thiscall , KEYMS)
-ALIAS("_vectorcall" , __vectorcall, KEYMS)
-ALIAS("_uuidof" , __uuidof , KEYMS | KEYBORLAND)
-ALIAS("_inline" , inline , KEYMS)
-ALIAS("_declspec" , __declspec , KEYMS)
+
+// Microsoft single-underscore prefixed aliases for double-underscore prefixed
+// keywords.
+ALIAS("_asm" , asm , KEYMS)
+ALIAS("_alignof" , __alignof , KEYMS)
+ALIAS("_cdecl" , __cdecl , KEYMS | KEYBORLAND)
+ALIAS("_declspec" , __declspec , KEYMS)
+ALIAS("_except" , __except , KEYMS)
+ALIAS("_fastcall" , __fastcall , KEYMS | KEYBORLAND)
+ALIAS("_finally" , __finally , KEYMS)
+ALIAS("_forceinline" , __forceinline, KEYMS)
+ALIAS("_inline" , inline , KEYMS)
+ALIAS("_int8" , char , KEYMS)
+ALIAS("_int16" , short , KEYMS)
+ALIAS("_int32" , int , KEYMS)
+ALIAS("_int64" , __int64 , KEYMS)
+ALIAS("_leave" , __leave , KEYMS)
+ALIAS("_multiple_inheritance", __multiple_inheritance, KEYMS)
+ALIAS("_ptr32" , __ptr32 , KEYMS)
+ALIAS("_ptr64" , __ptr64 , KEYMS)
+ALIAS("_restrict" , restrict , KEYMS)
+ALIAS("_stdcall" , __stdcall , KEYMS | KEYBORLAND)
+ALIAS("_thiscall" , __thiscall , KEYMS)
+ALIAS("_try" , __try , KEYMS)
+ALIAS("_vectorcall" , __vectorcall , KEYMS)
+ALIAS("_unaligned" , __unaligned , KEYMS)
+ALIAS("_uptr" , __uptr , KEYMS)
+ALIAS("_uuidof" , __uuidof , KEYMS | KEYBORLAND)
+ALIAS("_virtual_inheritance", __virtual_inheritance, KEYMS)
+ALIAS("_w64" , __w64 , KEYMS)
// Borland Extensions which should be disabled in strict conformance mode.
ALIAS("_pascal" , __pascal , KEYBORLAND)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121412.414490.patch
Type: text/x-patch
Size: 2938 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220310/2a4c2305/attachment.bin>
More information about the cfe-commits
mailing list