gcc/testsuite/obj-c++.dg/has-feature.mm
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | #define CXX11 (__cplusplus >= 201103L) |
| 4 | |
| 5 | #if !__has_feature (objc_instancetype) |
| 6 | #error |
| 7 | #endif |
| 8 | |
| 9 | #if !__has_feature (objc_default_synthesize_properties) |
| 10 | #error |
| 11 | #endif |
| 12 | |
| 13 | // C features should not be available. |
| 14 | #if __has_extension (c_alignas) || __has_feature (c_alignof) |
| 15 | #error |
| 16 | #endif |
| 17 | |
| 18 | // C++ features should be available (given the right standard). |
| 19 | #if __has_feature (cxx_constexpr) != CXX11 |
| 20 | #error |
| 21 | #endif |