Home | History | Annotate | Download | only in Preprocessor
      1 // RUN: %clang_cc1 %s -E -verify -fms-extensions
      2 // expected-no-diagnostics
      3 
      4 bool f() {
      5   // Check that operators still work before redefining them.
      6 #if compl 0 bitand 1
      7   return true and false;
      8 #endif
      9 }
     10 
     11 #ifdef and
     12 #endif
     13 
     14 // The second 'and' is a valid C++ operator name for '&&'.
     15 #if defined and and defined(and)
     16 #endif
     17 
     18 // All c++ keywords should be #define-able in ms mode.
     19 // (operators like "and" aren't normally, the rest always is.)
     20 #define and
     21 #define and_eq
     22 #define alignas
     23 #define alignof
     24 #define asm
     25 #define auto
     26 #define bitand
     27 #define bitor
     28 #define bool
     29 #define break
     30 #define case
     31 #define catch
     32 #define char
     33 #define char16_t
     34 #define char32_t
     35 #define class
     36 #define compl
     37 #define const
     38 #define constexpr
     39 #define const_cast
     40 #define continue
     41 #define decltype
     42 #define default
     43 #define delete
     44 #define double
     45 #define dynamic_cast
     46 #define else
     47 #define enum
     48 #define explicit
     49 #define export
     50 #define extern
     51 #define false
     52 #define float
     53 #define for
     54 #define friend
     55 #define goto
     56 #define if
     57 #define inline
     58 #define int
     59 #define long
     60 #define mutable
     61 #define namespace
     62 #define new
     63 #define noexcept
     64 #define not
     65 #define not_eq
     66 #define nullptr
     67 #define operator
     68 #define or
     69 #define or_eq
     70 #define private
     71 #define protected
     72 #define public
     73 #define register
     74 #define reinterpret_cast
     75 #define return
     76 #define short
     77 #define signed
     78 #define sizeof
     79 #define static
     80 #define static_assert
     81 #define static_cast
     82 #define struct
     83 #define switch
     84 #define template
     85 #define this
     86 #define thread_local
     87 #define throw
     88 #define true
     89 #define try
     90 #define typedef
     91 #define typeid
     92 #define typename
     93 #define union
     94 #define unsigned
     95 #define using
     96 #define virtual
     97 #define void
     98 #define volatile
     99 #define wchar_t
    100 #define while
    101 #define xor
    102 #define xor_eq
    103 
    104 // Check this is all properly defined away.
    105 and
    106 and_eq
    107 alignas
    108 alignof
    109 asm
    110 auto
    111 bitand
    112 bitor
    113 bool
    114 break
    115 case
    116 catch
    117 char
    118 char16_t
    119 char32_t
    120 class
    121 compl
    122 const
    123 constexpr
    124 const_cast
    125 continue
    126 decltype
    127 default
    128 delete
    129 double
    130 dynamic_cast
    131 else
    132 enum
    133 explicit
    134 export
    135 extern
    136 false
    137 float
    138 for
    139 friend
    140 goto
    141 if
    142 inline
    143 int
    144 long
    145 mutable
    146 namespace
    147 new
    148 noexcept
    149 not
    150 not_eq
    151 nullptr
    152 operator
    153 or
    154 or_eq
    155 private
    156 protected
    157 public
    158 register
    159 reinterpret_cast
    160 return
    161 short
    162 signed
    163 sizeof
    164 static
    165 static_assert
    166 static_cast
    167 struct
    168 switch
    169 template
    170 this
    171 thread_local
    172 throw
    173 true
    174 try
    175 typedef
    176 typeid
    177 typename
    178 union
    179 unsigned
    180 using
    181 virtual
    182 void
    183 volatile
    184 wchar_t
    185 while
    186 xor
    187 xor_eq
    188