1 // { dg-options "-std=c++14 -I${srcdir}/g++.dg/cpp1y -I${srcdir}/g++.dg/cpp1y/testinc" }
7 #elif __cpp_rtti != 199711
8 # error "__cpp_rtti != 199711"
11 #ifndef __cpp_exceptions
12 # error "__cpp_exceptions"
13 #elif __cpp_exceptions != 199711
14 # error "__cpp_exceptions != 199711"
19 #ifndef __cpp_unicode_characters
20 # error "__cpp_unicode_characters"
21 #elif __cpp_unicode_characters != 200704
22 # error "__cpp_unicode_characters != 200704"
25 #ifndef __cpp_raw_strings
26 # error "__cpp_raw_strings"
27 #elif __cpp_raw_strings != 200710
28 # error "__cpp_raw_strings != 200710"
31 #ifndef __cpp_unicode_literals
32 # error "__cpp_unicode_literals"
33 #elif __cpp_unicode_literals != 200710
34 # error "__cpp_unicode_literals != 200710"
37 #ifndef __cpp_user_defined_literals
38 # error "__cpp_user_defined_literals"
39 #elif __cpp_user_defined_literals != 200809
40 # error "__cpp_user_defined_literals != 200809"
44 # error "__cpp_lambdas"
45 #elif __cpp_lambdas != 200907
46 # error "__cpp_lambdas != 200907"
49 #ifndef __cpp_range_based_for
50 # error "__cpp_range_based_for"
51 #elif __cpp_range_based_for < 200907
52 # error "__cpp_range_based_for < 200907"
55 #ifndef __cpp_static_assert
56 # error "__cpp_static_assert"
57 #elif __cpp_static_assert != 200410
58 # error "__cpp_static_assert != 200410"
61 #ifndef __cpp_decltype
62 # error "__cpp_decltype"
63 #elif __cpp_decltype != 200707
64 # error "__cpp_decltype != 200707"
67 #ifndef __cpp_attributes
68 # error "__cpp_attributes"
69 #elif __cpp_attributes != 200809
70 # error "__cpp_attributes != 200809"
73 #ifndef __cpp_rvalue_references
74 # error "__cpp_rvalue_references"
75 #elif __cpp_rvalue_references != 200610
76 # error "__cpp_rvalue_references != 200610"
79 #ifndef __cpp_variadic_templates
80 # error "__cpp_variadic_templates"
81 #elif __cpp_variadic_templates != 200704
82 # error "__cpp_variadic_templates != 200704"
85 #ifndef __cpp_initializer_lists
86 # error "__cpp_initializer_lists"
87 #elif __cpp_initializer_lists != 200806
88 # error "__cpp_initializer_lists != 200806"
91 #ifndef __cpp_delegating_constructors
92 # error "__cpp_delegating_constructors"
93 #elif __cpp_delegating_constructors != 200604
94 # error "__cpp_delegating_constructors != 200604"
99 #elif __cpp_nsdmi != 200809
100 # error "__cpp_nsdmi != 200809"
103 #ifndef __cpp_inheriting_constructors
104 # error "__cpp_inheriting_constructors"
105 #elif __cpp_inheriting_constructors!= 201511
106 # error "__cpp_inheriting_constructors != 201511"
109 #ifndef __cpp_ref_qualifiers
110 # error "__cpp_ref_qualifiers"
111 #elif __cpp_ref_qualifiers != 200710
112 # error "__cpp_ref_qualifiers != 200710"
115 #ifndef __cpp_alias_templates
116 # error "__cpp_alias_templates"
117 #elif __cpp_alias_templates != 200704
118 # error "__cpp_alias_templates != 200704"
121 #ifndef __cpp_threadsafe_static_init
122 # error "__cpp_threadsafe_static_init"
123 #elif __cpp_threadsafe_static_init != 200806
124 # error "__cpp_threadsafe_static_init != 200806"
129 #ifndef __cpp_binary_literals
130 # error "__cpp_binary_literals"
131 #elif __cpp_binary_literals != 201304
132 # error "__cpp_binary_literals != 201304"
135 #ifndef __cpp_init_captures
136 # error "__cpp_init_captures"
137 #elif __cpp_init_captures != 201304
138 # error "__cpp_init_captures != 201304"
141 #ifndef __cpp_generic_lambdas
142 # error "__cpp_generic_lambdas"
143 #elif __cpp_generic_lambdas != 201304
144 # error "__cpp_generic_lambdas != 201304"
147 #ifndef __cpp_constexpr
148 # error "__cpp_constexpr"
149 #elif __cpp_constexpr != 201304
150 # error "__cpp_constexpr != 201304"
153 #ifndef __cpp_decltype_auto
154 # error "__cpp_decltype_auto"
155 #elif __cpp_decltype_auto != 201304
156 # error "__cpp_decltype_auto != 201304"
159 #ifndef __cpp_return_type_deduction
160 # error "__cpp_return_type_deduction"
161 #elif __cpp_return_type_deduction != 201304
162 # error "__cpp_return_type_deduction != 201304"
165 #ifndef __cpp_aggregate_nsdmi
166 # error "__cpp_aggregate_nsdmi"
167 #elif __cpp_aggregate_nsdmi != 201304
168 # error "__cpp_aggregate_nsdmi != 201304"
171 #ifndef __cpp_variable_templates
172 # error "__cpp_variable_templates"
173 #elif __cpp_variable_templates != 201304
174 # error "__cpp_variable_templates != 201304"
177 #ifndef __cpp_digit_separators
178 # error "__cpp_digit_separators"
179 #elif __cpp_digit_separators != 201309
180 # error "__cpp_digit_separators != 201309"
183 #ifndef __cpp_sized_deallocation
184 # error "__cpp_sized_deallocation"
185 #elif __cpp_sized_deallocation != 201309
186 # error "__cpp_sized_deallocation != 201309"
191 #ifndef __cpp_runtime_arrays
192 # error "__cpp_runtime_arrays"
193 #elif __cpp_runtime_arrays != 198712
194 # error "__cpp_runtime_arrays != 198712"
199 #ifdef __has_cpp_attribute
200 # if ! __has_cpp_attribute(noreturn)
201 # error "__has_cpp_attribute(noreturn)"
202 # elif __has_cpp_attribute(noreturn) != 200809
203 # error "__has_cpp_attribute(noreturn) != 200809"
206 # error "__has_cpp_attribute"
209 // Attribute carries_dependency not in yet.
210 //#ifdef __has_cpp_attribute
211 //# if ! __has_cpp_attribute(carries_dependency)
212 //# error "__has_cpp_attribute(carries_dependency)"
213 //# elif __has_cpp_attribute(carries_dependency) != 200809
214 //# error "__has_cpp_attribute(carries_dependency) != 200809"
217 //# error "__has_cpp_attribute"
222 #ifdef __has_cpp_attribute
223 # if ! __has_cpp_attribute(deprecated)
224 # error "__has_cpp_attribute(deprecated)"
225 # elif __has_cpp_attribute(deprecated) != 201309
226 # error "__has_cpp_attribute(deprecated) != 201309"
229 # error "__has_cpp_attribute"
234 // Check for __has_include macro.
235 #ifndef __has_include
236 # error "__has_include"
239 // Quoted complex.h should find at least the bracket version (use operator).
240 #if __has_include__ "complex.h"
245 // Try known bracket header (use operator).
246 #if __has_include__(<complex>)
251 // Define and use a macro to invoke the operator.
252 #define sluggo(TXT) __has_include__(TXT)
254 #if sluggo(<complex>)
259 #if ! sluggo(<complex>)
264 // Quoted complex.h should find at least the bracket version.
265 #if __has_include("complex.h")
270 // Try known local quote header.
271 #if __has_include("complex_literals.h")
273 # error "\"complex_literals.h\""
276 // Try nonexistent bracket header.
277 #if __has_include(<stuff>)
282 // Try nonexistent quote header.
283 #if __has_include("phlegm")
288 // Test __has_include_next.
289 #if __has_include("phoobhar.h")
290 # include "phoobhar.h"
292 # error "__has_include(\"phoobhar.h\")"
296 #define COMPLEX_INC "complex.h"
297 #if __has_include(COMPLEX_INC)
302 // Realistic use of __has_include.
303 #if __has_include(<array>)
306 template<typename _Tp, size_t _Num>
307 using array = std::array<_Tp, _Num>;
308 #elif __has_include(<tr1/array>)
310 # include <tr1/array>
311 template<typename _Tp, size_t _Num>
312 typedef std::tr1::array<_Tp, _Num> array;