blob: a22cf64c205d6598b74e2e2da029d2b5481af205 [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -E -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-0X %s
Daniel Dunbar9fde9c42010-06-29 16:52:24 +00002// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-0X %s
Sean Hunt4ef4c6b2010-01-13 08:31:49 +00003
4#if __has_feature(cxx_lambdas)
Douglas Gregorc78e2592011-01-26 15:36:03 +00005int has_lambdas();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +00006#else
7int no_lambdas();
8#endif
9
10// CHECK-0X: no_lambdas
11// CHECK-NO-0X: no_lambdas
12
13
14#if __has_feature(cxx_nullptr)
Sean Hunt12484512010-01-13 08:58:42 +000015int has_nullptr();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000016#else
17int no_nullptr();
18#endif
19
Douglas Gregor84ee2ee2011-05-21 23:15:46 +000020// CHECK-0X: has_nullptr
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000021// CHECK-NO-0X: no_nullptr
22
23
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000024#if __has_feature(cxx_decltype)
Sean Hunt12484512010-01-13 08:58:42 +000025int has_decltype();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000026#else
27int no_decltype();
28#endif
29
Sean Hunt12484512010-01-13 08:58:42 +000030// CHECK-0X: has_decltype
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000031// CHECK-NO-0X: no_decltype
32
33
34#if __has_feature(cxx_auto_type)
Douglas Gregorc78e2592011-01-26 15:36:03 +000035int has_auto_type();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000036#else
37int no_auto_type();
38#endif
39
Richard Smith738291e2011-02-20 12:13:05 +000040// CHECK-0X: has_auto_type
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000041// CHECK-NO-0X: no_auto_type
42
43
Richard Smith6a4e73c2011-04-03 14:12:46 +000044#if __has_feature(cxx_trailing_return)
45int has_trailing_return();
46#else
47int no_trailing_return();
48#endif
49
50// CHECK-0X: has_trailing_return
51// CHECK-NO-0X: no_trailing_return
52
53
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000054#if __has_feature(cxx_attributes)
Douglas Gregorc78e2592011-01-26 15:36:03 +000055int has_attributes();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000056#else
57int no_attributes();
58#endif
59
Douglas Gregorc78e2592011-01-26 15:36:03 +000060// CHECK-0X: has_attributes
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000061// CHECK-NO-0X: no_attributes
62
63
64#if __has_feature(cxx_static_assert)
Sean Hunt12484512010-01-13 08:58:42 +000065int has_static_assert();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000066#else
67int no_static_assert();
68#endif
69
Sean Hunt12484512010-01-13 08:58:42 +000070// CHECK-0X: has_static_assert
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000071// CHECK-NO-0X: no_static_assert
72
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000073#if __has_feature(cxx_deleted_functions)
Douglas Gregorc78e2592011-01-26 15:36:03 +000074int has_deleted_functions();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000075#else
76int no_deleted_functions();
77#endif
78
Douglas Gregorc78e2592011-01-26 15:36:03 +000079// CHECK-0X: has_deleted_functions
80// CHECK-NO-0X: no_deleted_functions
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000081
Douglas Gregorf695a692011-11-01 01:19:34 +000082#if __has_feature(cxx_defaulted_functions)
83int has_defaulted_functions();
84#else
85int no_defaulted_functions();
86#endif
87
88// CHECK-0X: has_defaulted_functions
89// CHECK-NO-0X: no_defaulted_functions
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000090
91#if __has_feature(cxx_rvalue_references)
Douglas Gregorc78e2592011-01-26 15:36:03 +000092int has_rvalue_references();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000093#else
94int no_rvalue_references();
95#endif
96
Douglas Gregorc78e2592011-01-26 15:36:03 +000097// CHECK-0X: has_rvalue_references
98// CHECK-NO-0X: no_rvalue_references
Sean Hunt4ef4c6b2010-01-13 08:31:49 +000099
100
101#if __has_feature(cxx_variadic_templates)
Douglas Gregorc78e2592011-01-26 15:36:03 +0000102int has_variadic_templates();
Sean Hunt4ef4c6b2010-01-13 08:31:49 +0000103#else
104int no_variadic_templates();
105#endif
106
Douglas Gregorc78e2592011-01-26 15:36:03 +0000107// CHECK-0X: has_variadic_templates
108// CHECK-NO-0X: no_variadic_templates
Sebastian Redlf6c09772010-08-31 23:28:47 +0000109
110
111#if __has_feature(cxx_inline_namespaces)
Douglas Gregorc78e2592011-01-26 15:36:03 +0000112int has_inline_namespaces();
Sebastian Redlf6c09772010-08-31 23:28:47 +0000113#else
114int no_inline_namespaces();
115#endif
116
Douglas Gregorc78e2592011-01-26 15:36:03 +0000117// CHECK-0X: has_inline_namespaces
118// CHECK-NO-0X: no_inline_namespaces
Douglas Gregor56209ff2011-01-26 21:25:54 +0000119
Richard Smitha391a462011-04-15 15:14:40 +0000120
121#if __has_feature(cxx_range_for)
122int has_range_for();
123#else
124int no_range_for();
125#endif
126
127// CHECK-0X: has_range_for
128// CHECK-NO-0X: no_range_for
129
130
Douglas Gregor56209ff2011-01-26 21:25:54 +0000131#if __has_feature(cxx_reference_qualified_functions)
132int has_reference_qualified_functions();
133#else
134int no_reference_qualified_functions();
135#endif
136
137// CHECK-0X: has_reference_qualified_functions
138// CHECK-NO-0X: no_reference_qualified_functions
139
Douglas Gregor07508002011-02-05 20:35:30 +0000140#if __has_feature(cxx_default_function_template_args)
141int has_default_function_template_args();
142#else
143int no_default_function_template_args();
144#endif
145
146// CHECK-0X: has_default_function_template_args
147// CHECK-NO-0X: no_default_function_template_args
148
Sebastian Redl4561ecd2011-03-15 21:17:12 +0000149#if __has_feature(cxx_noexcept)
150int has_noexcept();
151#else
152int no_noexcept();
153#endif
154
155// CHECK-0X: has_noexcept
156// CHECK-NO-0X: no_noexcept
157
Anders Carlssonc8b9f792011-03-25 15:04:23 +0000158#if __has_feature(cxx_override_control)
159int has_override_control();
160#else
161int no_override_control();
162#endif
163
164// CHECK-0X: has_override_control
165// CHECK-NO-0X: no_override_control
Richard Smith3e4c6c42011-05-05 21:57:07 +0000166
167#if __has_feature(cxx_alias_templates)
168int has_alias_templates();
169#else
170int no_alias_templates();
171#endif
172
173// CHECK-0X: has_alias_templates
174// CHECK-NO-0X: no_alias_templates
Sebastian Redl74e611a2011-09-04 18:14:28 +0000175
176#if __has_feature(cxx_implicit_moves)
177int has_implicit_moves();
178#else
179int no_implicit_moves();
180#endif
181
182// CHECK-0X: has_implicit_moves
183// CHECK-NO-0X: no_implicit_moves
Peter Collingbournefd5f6862011-10-14 23:44:46 +0000184
185#if __has_feature(cxx_alignas)
186int has_alignas();
187#else
188int no_alignas();
189#endif
190
191// CHECK-0X: has_alignas
192// CHECK-NO-0X: no_alignas
Douglas Gregor172b2212011-11-01 01:23:44 +0000193
194#if __has_feature(cxx_raw_string_literals)
195int has_raw_string_literals();
196#else
197int no_raw_string_literals();
198#endif
199
200// CHECK-0X: has_raw_string_literals
201// CHECK-NO-0X: no_raw_string_literals
202
203#if __has_feature(cxx_unicode_literals)
204int has_unicode_literals();
205#else
206int no_unicode_literals();
207#endif
208
209// CHECK-0X: has_unicode_literals
210// CHECK-NO-0X: no_unicode_literals