Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
234 // Check for __has_include macro. | 234 // Check for __has_include macro. |
235 #ifndef __has_include | 235 #ifndef __has_include |
236 # error "__has_include" | 236 # error "__has_include" |
237 #endif | 237 #endif |
238 | 238 |
239 // Quoted complex.h should find at least the bracket version (use operator). | |
240 #if __has_include__ "complex.h" | |
241 #else | |
242 # error "complex.h" | |
243 #endif | |
244 | |
245 // Try known bracket header (use operator). | 239 // Try known bracket header (use operator). |
246 #if __has_include__(<complex>) | 240 #if __has_include (<complex>) |
247 #else | 241 #else |
248 # error "<complex>" | 242 # error "<complex>" |
249 #endif | 243 #endif |
250 | 244 |
251 // Define and use a macro to invoke the operator. | 245 // Define and use a macro to invoke the operator. |
252 #define sluggo(TXT) __has_include__(TXT) | 246 #define sluggo(TXT) __has_include(TXT) |
253 | 247 |
254 #if sluggo(<complex>) | 248 #if sluggo(<complex>) |
255 #else | 249 #else |
256 # error "<complex>" | 250 # error "<complex>" |
257 #endif | 251 #endif |
301 | 295 |
302 // Realistic use of __has_include. | 296 // Realistic use of __has_include. |
303 #if __has_include(<array>) | 297 #if __has_include(<array>) |
304 # define STD_ARRAY 1 | 298 # define STD_ARRAY 1 |
305 # include <array> | 299 # include <array> |
306 template<typename _Tp, size_t _Num> | 300 template<typename _Tp, std::size_t _Num> |
307 using array = std::array<_Tp, _Num>; | 301 using array = std::array<_Tp, _Num>; |
308 #elif __has_include(<tr1/array>) | 302 #elif __has_include(<tr1/array>) |
309 # define TR1_ARRAY 1 | 303 # define TR1_ARRAY 1 |
310 # include <tr1/array> | 304 # include <tr1/array> |
311 template<typename _Tp, size_t _Num> | 305 template<typename _Tp, std::size_t _Num> |
312 typedef std::tr1::array<_Tp, _Num> array; | 306 typedef std::tr1::array<_Tp, _Num> array; |
313 #endif | 307 #endif |