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