1// RUN: %clang_cc1 %s -E -verify -fms-extensions 2// expected-no-diagnostics 3 4bool 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. 105and 106and_eq 107alignas 108alignof 109asm 110auto 111bitand 112bitor 113bool 114break 115case 116catch 117char 118char16_t 119char32_t 120class 121compl 122const 123constexpr 124const_cast 125continue 126decltype 127default 128delete 129double 130dynamic_cast 131else 132enum 133explicit 134export 135extern 136false 137float 138for 139friend 140goto 141if 142inline 143int 144long 145mutable 146namespace 147new 148noexcept 149not 150not_eq 151nullptr 152operator 153or 154or_eq 155private 156protected 157public 158register 159reinterpret_cast 160return 161short 162signed 163sizeof 164static 165static_assert 166static_cast 167struct 168switch 169template 170this 171thread_local 172throw 173true 174try 175typedef 176typeid 177typename 178union 179unsigned 180using 181virtual 182void 183volatile 184wchar_t 185while 186xor 187xor_eq 188