[cfe-commits] r151776 - in /cfe/trunk: lib/Lex/PPDirectives.cpp test/Preprocessor/cxx_oper_keyword_ms_compat.cpp test/Preprocessor/cxx_oper_keyword_ms_ext.cpp

Nico Weber nicolasweber at gmx.de
Wed Feb 29 16:13:46 PST 2012


Author: nico
Date: Wed Feb 29 18:13:46 2012
New Revision: 151776

URL: http://llvm.org/viewvc/llvm-project?rev=151776&view=rev
Log:
Move suport for redefining operator keywords from -fms-extensions to -fms-compatibility.


Added:
    cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_compat.cpp
      - copied, changed from r151768, cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_ext.cpp
Removed:
    cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_ext.cpp
Modified:
    cfe/trunk/lib/Lex/PPDirectives.cpp

Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=151776&r1=151775&r2=151776&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Wed Feb 29 18:13:46 2012
@@ -124,7 +124,7 @@
     const IdentifierInfo &Info = Identifiers.get(Spelling);
 
     // Allow #defining |and| and friends in microsoft mode.
-    if (Info.isCPlusPlusOperatorKeyword() && getLangOptions().MicrosoftExt) {
+    if (Info.isCPlusPlusOperatorKeyword() && getLangOptions().MicrosoftMode) {
       MacroNameTok.setIdentifierInfo(getIdentifierInfo(Spelling));
       return;
     }

Copied: cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_compat.cpp (from r151768, cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_ext.cpp)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_compat.cpp?p2=cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_compat.cpp&p1=cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_ext.cpp&r1=151768&r2=151776&rev=151776&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_ext.cpp (original)
+++ cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_compat.cpp Wed Feb 29 18:13:46 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -E -fms-extensions
+// RUN: %clang_cc1 %s -E -fms-compatibility
 
 bool f() {
   // Check that operators still work before redefining them.

Removed: cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_ext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_ext.cpp?rev=151775&view=auto
==============================================================================
--- cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_ext.cpp (original)
+++ cfe/trunk/test/Preprocessor/cxx_oper_keyword_ms_ext.cpp (removed)
@@ -1,179 +0,0 @@
-// RUN: %clang_cc1 %s -E -fms-extensions
-
-bool f() {
-  // Check that operators still work before redefining them.
-#if compl 0 bitand 1
-  return true and false;
-#endif
-}
-
-// All c++ keywords should be #define-able in ms mode.
-// (operators like "and" aren't normally, the rest always is.)
-#define and
-#define and_eq
-#define alignas
-#define alignof
-#define asm
-#define auto
-#define bitand
-#define bitor
-#define bool
-#define break
-#define case
-#define catch
-#define char
-#define char16_t
-#define char32_t
-#define class
-#define compl
-#define const
-#define constexpr
-#define const_cast
-#define continue
-#define decltype
-#define default
-#define delete
-#define double
-#define dynamic_cast
-#define else
-#define enum
-#define explicit
-#define export
-#define extern
-#define false
-#define float
-#define for
-#define friend
-#define goto
-#define if
-#define inline
-#define int
-#define long
-#define mutable
-#define namespace
-#define new
-#define noexcept
-#define not
-#define not_eq
-#define nullptr
-#define operator
-#define or
-#define or_eq
-#define private
-#define protected
-#define public
-#define register
-#define reinterpret_cast
-#define return
-#define short
-#define signed
-#define sizeof
-#define static
-#define static_assert
-#define static_cast
-#define struct
-#define switch
-#define template
-#define this
-#define thread_local
-#define throw
-#define true
-#define try
-#define typedef
-#define typeid
-#define typename
-#define union
-#define unsigned
-#define using
-#define virtual
-#define void
-#define volatile
-#define wchar_t
-#define while
-#define xor
-#define xor_eq
-
-// Check this is all properly defined away.
-and
-and_eq
-alignas
-alignof
-asm
-auto
-bitand
-bitor
-bool
-break
-case
-catch
-char
-char16_t
-char32_t
-class
-compl
-const
-constexpr
-const_cast
-continue
-decltype
-default
-delete
-double
-dynamic_cast
-else
-enum
-explicit
-export
-extern
-false
-float
-for
-friend
-goto
-if
-inline
-int
-long
-mutable
-namespace
-new
-noexcept
-not
-not_eq
-nullptr
-operator
-or
-or_eq
-private
-protected
-public
-register
-reinterpret_cast
-return
-short
-signed
-sizeof
-static
-static_assert
-static_cast
-struct
-switch
-template
-this
-thread_local
-throw
-true
-try
-typedef
-typeid
-typename
-union
-unsigned
-using
-virtual
-void
-volatile
-wchar_t
-while
-xor
-xor_eq





More information about the cfe-commits mailing list