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