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