blob: f2b4576b57e96ad33592a5e9b9c9309c29841e9c [file] [log] [blame]
Richard Smith9ca5c422011-10-13 22:29:44 +00001// RUN: %clang_cc1 -E -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-0X %s
Daniel Dunbar8452ef02010-06-29 16:52:24 +00002// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-0X %s
Alexis Huntaf4e28d2010-01-13 08:31:49 +00003
4#if __has_feature(cxx_lambdas)
Douglas Gregorc41d94e2011-01-26 15:36:03 +00005int has_lambdas();
Alexis Huntaf4e28d2010-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)
Alexis Hunt10e2f722010-01-13 08:58:42 +000015int has_nullptr();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000016#else
17int no_nullptr();
18#endif
19
Douglas Gregor80af3132011-05-21 23:15:46 +000020// CHECK-0X: has_nullptr
Alexis Huntaf4e28d2010-01-13 08:31:49 +000021// CHECK-NO-0X: no_nullptr
22
23
Alexis Huntaf4e28d2010-01-13 08:31:49 +000024#if __has_feature(cxx_decltype)
Alexis Hunt10e2f722010-01-13 08:58:42 +000025int has_decltype();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000026#else
27int no_decltype();
28#endif
29
Alexis Hunt10e2f722010-01-13 08:58:42 +000030// CHECK-0X: has_decltype
Alexis Huntaf4e28d2010-01-13 08:31:49 +000031// CHECK-NO-0X: no_decltype
32
33
34#if __has_feature(cxx_auto_type)
Douglas Gregorc41d94e2011-01-26 15:36:03 +000035int has_auto_type();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000036#else
37int no_auto_type();
38#endif
39
Richard Smith7ee0d562011-02-20 12:13:05 +000040// CHECK-0X: has_auto_type
Alexis Huntaf4e28d2010-01-13 08:31:49 +000041// CHECK-NO-0X: no_auto_type
42
43
Richard Smith13f68cf2011-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
Alexis Huntaf4e28d2010-01-13 08:31:49 +000054#if __has_feature(cxx_attributes)
Douglas Gregorc41d94e2011-01-26 15:36:03 +000055int has_attributes();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000056#else
57int no_attributes();
58#endif
59
Douglas Gregorc41d94e2011-01-26 15:36:03 +000060// CHECK-0X: has_attributes
Alexis Huntaf4e28d2010-01-13 08:31:49 +000061// CHECK-NO-0X: no_attributes
62
63
64#if __has_feature(cxx_static_assert)
Alexis Hunt10e2f722010-01-13 08:58:42 +000065int has_static_assert();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000066#else
67int no_static_assert();
68#endif
69
Alexis Hunt10e2f722010-01-13 08:58:42 +000070// CHECK-0X: has_static_assert
Alexis Huntaf4e28d2010-01-13 08:31:49 +000071// CHECK-NO-0X: no_static_assert
72
Alexis Huntaf4e28d2010-01-13 08:31:49 +000073#if __has_feature(cxx_deleted_functions)
Douglas Gregorc41d94e2011-01-26 15:36:03 +000074int has_deleted_functions();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000075#else
76int no_deleted_functions();
77#endif
78
Douglas Gregorc41d94e2011-01-26 15:36:03 +000079// CHECK-0X: has_deleted_functions
80// CHECK-NO-0X: no_deleted_functions
Alexis Huntaf4e28d2010-01-13 08:31:49 +000081
82
83#if __has_feature(cxx_rvalue_references)
Douglas Gregorc41d94e2011-01-26 15:36:03 +000084int has_rvalue_references();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000085#else
86int no_rvalue_references();
87#endif
88
Douglas Gregorc41d94e2011-01-26 15:36:03 +000089// CHECK-0X: has_rvalue_references
90// CHECK-NO-0X: no_rvalue_references
Alexis Huntaf4e28d2010-01-13 08:31:49 +000091
92
93#if __has_feature(cxx_variadic_templates)
Douglas Gregorc41d94e2011-01-26 15:36:03 +000094int has_variadic_templates();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000095#else
96int no_variadic_templates();
97#endif
98
Douglas Gregorc41d94e2011-01-26 15:36:03 +000099// CHECK-0X: has_variadic_templates
100// CHECK-NO-0X: no_variadic_templates
Sebastian Redla93bb5b2010-08-31 23:28:47 +0000101
102
103#if __has_feature(cxx_inline_namespaces)
Douglas Gregorc41d94e2011-01-26 15:36:03 +0000104int has_inline_namespaces();
Sebastian Redla93bb5b2010-08-31 23:28:47 +0000105#else
106int no_inline_namespaces();
107#endif
108
Douglas Gregorc41d94e2011-01-26 15:36:03 +0000109// CHECK-0X: has_inline_namespaces
110// CHECK-NO-0X: no_inline_namespaces
Douglas Gregor56d5f0a2011-01-26 21:25:54 +0000111
Richard Smith9bc6eed2011-04-15 15:14:40 +0000112
113#if __has_feature(cxx_range_for)
114int has_range_for();
115#else
116int no_range_for();
117#endif
118
119// CHECK-0X: has_range_for
120// CHECK-NO-0X: no_range_for
121
122
Douglas Gregor56d5f0a2011-01-26 21:25:54 +0000123#if __has_feature(cxx_reference_qualified_functions)
124int has_reference_qualified_functions();
125#else
126int no_reference_qualified_functions();
127#endif
128
129// CHECK-0X: has_reference_qualified_functions
130// CHECK-NO-0X: no_reference_qualified_functions
131
Douglas Gregor7115aee2011-02-05 20:35:30 +0000132#if __has_feature(cxx_default_function_template_args)
133int has_default_function_template_args();
134#else
135int no_default_function_template_args();
136#endif
137
138// CHECK-0X: has_default_function_template_args
139// CHECK-NO-0X: no_default_function_template_args
140
Sebastian Redlc17003c2011-03-15 21:17:12 +0000141#if __has_feature(cxx_noexcept)
142int has_noexcept();
143#else
144int no_noexcept();
145#endif
146
147// CHECK-0X: has_noexcept
148// CHECK-NO-0X: no_noexcept
149
Anders Carlsson69f1f932011-03-25 15:04:23 +0000150#if __has_feature(cxx_override_control)
151int has_override_control();
152#else
153int no_override_control();
154#endif
155
156// CHECK-0X: has_override_control
157// CHECK-NO-0X: no_override_control
Richard Smith3f1b5d02011-05-05 21:57:07 +0000158
159#if __has_feature(cxx_alias_templates)
160int has_alias_templates();
161#else
162int no_alias_templates();
163#endif
164
165// CHECK-0X: has_alias_templates
166// CHECK-NO-0X: no_alias_templates
Sebastian Redle9c4e842011-09-04 18:14:28 +0000167
168#if __has_feature(cxx_implicit_moves)
169int has_implicit_moves();
170#else
171int no_implicit_moves();
172#endif
173
174// CHECK-0X: has_implicit_moves
175// CHECK-NO-0X: no_implicit_moves
Peter Collingbourne60188eb2011-10-14 23:44:46 +0000176
177#if __has_feature(cxx_alignas)
178int has_alignas();
179#else
180int no_alignas();
181#endif
182
183// CHECK-0X: has_alignas
184// CHECK-NO-0X: no_alignas