has_feature_cxx0x.cpp revision 316551f079a182d15c0e9b930c361428c968b5ee
1// RUN: %clang_cc1 -E -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-0X %s
2// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-0X %s
3
4#if __has_feature(cxx_atomic)
5int has_atomic();
6#else
7int no_atomic();
8#endif
9
10// CHECK-0X: has_atomic
11// CHECK-NO-0X: no_atomic
12
13#if __has_feature(cxx_lambdas)
14int has_lambdas();
15#else
16int no_lambdas();
17#endif
18
19// CHECK-0X: has_lambdas
20// CHECK-NO-0X: no_lambdas
21
22
23#if __has_feature(cxx_nullptr)
24int has_nullptr();
25#else
26int no_nullptr();
27#endif
28
29// CHECK-0X: has_nullptr
30// CHECK-NO-0X: no_nullptr
31
32
33#if __has_feature(cxx_decltype)
34int has_decltype();
35#else
36int no_decltype();
37#endif
38
39// CHECK-0X: has_decltype
40// CHECK-NO-0X: no_decltype
41
42
43#if __has_feature(cxx_decltype_incomplete_return_types)
44int has_decltype_incomplete_return_types();
45#else
46int no_decltype_incomplete_return_types();
47#endif
48
49// CHECK-0X: has_decltype_incomplete_return_types
50// CHECK-NO-0X: no_decltype_incomplete_return_types
51
52
53#if __has_feature(cxx_auto_type)
54int has_auto_type();
55#else
56int no_auto_type();
57#endif
58
59// CHECK-0X: has_auto_type
60// CHECK-NO-0X: no_auto_type
61
62
63#if __has_feature(cxx_trailing_return)
64int has_trailing_return();
65#else
66int no_trailing_return();
67#endif
68
69// CHECK-0X: has_trailing_return
70// CHECK-NO-0X: no_trailing_return
71
72
73#if __has_feature(cxx_attributes)
74int has_attributes();
75#else
76int no_attributes();
77#endif
78
79// CHECK-0X: has_attributes
80// CHECK-NO-0X: no_attributes
81
82
83#if __has_feature(cxx_static_assert)
84int has_static_assert();
85#else
86int no_static_assert();
87#endif
88
89// CHECK-0X: has_static_assert
90// CHECK-NO-0X: no_static_assert
91
92#if __has_feature(cxx_deleted_functions)
93int has_deleted_functions();
94#else
95int no_deleted_functions();
96#endif
97
98// CHECK-0X: has_deleted_functions
99// CHECK-NO-0X: no_deleted_functions
100
101#if __has_feature(cxx_defaulted_functions)
102int has_defaulted_functions();
103#else
104int no_defaulted_functions();
105#endif
106
107// CHECK-0X: has_defaulted_functions
108// CHECK-NO-0X: no_defaulted_functions
109
110#if __has_feature(cxx_rvalue_references)
111int has_rvalue_references();
112#else
113int no_rvalue_references();
114#endif
115
116// CHECK-0X: has_rvalue_references
117// CHECK-NO-0X: no_rvalue_references
118
119
120#if __has_feature(cxx_variadic_templates)
121int has_variadic_templates();
122#else
123int no_variadic_templates();
124#endif
125
126// CHECK-0X: has_variadic_templates
127// CHECK-NO-0X: no_variadic_templates
128
129
130#if __has_feature(cxx_inline_namespaces)
131int has_inline_namespaces();
132#else
133int no_inline_namespaces();
134#endif
135
136// CHECK-0X: has_inline_namespaces
137// CHECK-NO-0X: no_inline_namespaces
138
139
140#if __has_feature(cxx_range_for)
141int has_range_for();
142#else
143int no_range_for();
144#endif
145
146// CHECK-0X: has_range_for
147// CHECK-NO-0X: no_range_for
148
149
150#if __has_feature(cxx_reference_qualified_functions)
151int has_reference_qualified_functions();
152#else
153int no_reference_qualified_functions();
154#endif
155
156// CHECK-0X: has_reference_qualified_functions
157// CHECK-NO-0X: no_reference_qualified_functions
158
159#if __has_feature(cxx_default_function_template_args)
160int has_default_function_template_args();
161#else
162int no_default_function_template_args();
163#endif
164
165// CHECK-0X: has_default_function_template_args
166// CHECK-NO-0X: no_default_function_template_args
167
168#if __has_feature(cxx_noexcept)
169int has_noexcept();
170#else
171int no_noexcept();
172#endif
173
174// CHECK-0X: has_noexcept
175// CHECK-NO-0X: no_noexcept
176
177#if __has_feature(cxx_override_control)
178int has_override_control();
179#else
180int no_override_control();
181#endif
182
183// CHECK-0X: has_override_control
184// CHECK-NO-0X: no_override_control
185
186#if __has_feature(cxx_alias_templates)
187int has_alias_templates();
188#else
189int no_alias_templates();
190#endif
191
192// CHECK-0X: has_alias_templates
193// CHECK-NO-0X: no_alias_templates
194
195#if __has_feature(cxx_implicit_moves)
196int has_implicit_moves();
197#else
198int no_implicit_moves();
199#endif
200
201// CHECK-0X: has_implicit_moves
202// CHECK-NO-0X: no_implicit_moves
203
204#if __has_feature(cxx_alignas)
205int has_alignas();
206#else
207int no_alignas();
208#endif
209
210// CHECK-0X: has_alignas
211// CHECK-NO-0X: no_alignas
212
213#if __has_feature(cxx_raw_string_literals)
214int has_raw_string_literals();
215#else
216int no_raw_string_literals();
217#endif
218
219// CHECK-0X: has_raw_string_literals
220// CHECK-NO-0X: no_raw_string_literals
221
222#if __has_feature(cxx_unicode_literals)
223int has_unicode_literals();
224#else
225int no_unicode_literals();
226#endif
227
228// CHECK-0X: has_unicode_literals
229// CHECK-NO-0X: no_unicode_literals
230
231#if __has_feature(cxx_constexpr)
232int has_constexpr();
233#else
234int no_constexpr();
235#endif
236
237// CHECK-0X: has_constexpr
238// CHECK-NO-0X: no_constexpr
239
240#if __has_feature(cxx_generalized_initializers)
241int has_generalized_initializers();
242#else
243int no_generalized_initializers();
244#endif
245
246// CHECK-0X: has_generalized_initializers
247// CHECK-NO-0X: no_generalized_initializers
248
249#if __has_feature(cxx_unrestricted_unions)
250int has_unrestricted_unions();
251#else
252int no_unrestricted_unions();
253#endif
254
255// CHECK-0X: has_unrestricted_unions
256// CHECK-NO-0X: no_unrestricted_unions
257
258#if __has_feature(cxx_user_literals)
259int has_user_literals();
260#else
261int no_user_literals();
262#endif
263
264// CHECK-0X: has_user_literals
265// CHECK-NO-0X: no_user_literals
266
267#if __has_feature(cxx_local_type_template_args)
268int has_local_type_template_args();
269#else
270int no_local_type_template_args();
271#endif
272
273// CHECK-0X: has_local_type_template_args
274// CHECK-NO-0X: no_local_type_template_args
275