| 1 |
// { dg-do compile { target c++98_only } } |
| 2 |
|
| 3 |
// C++11 features: |
| 4 |
|
| 5 |
#ifndef __cpp_runtime_arrays |
| 6 |
# error "__cpp_runtime_arrays" // { dg-error "error" } |
| 7 |
#endif |
| 8 |
|
| 9 |
#ifndef __cpp_unicode_characters |
| 10 |
# error "__cpp_unicode_characters" // { dg-error "error" } |
| 11 |
#endif |
| 12 |
|
| 13 |
#ifndef __cpp_raw_strings |
| 14 |
# error "__cpp_raw_strings" // { dg-error "error" } |
| 15 |
#endif |
| 16 |
|
| 17 |
#ifndef __cpp_unicode_literals |
| 18 |
# error "__cpp_unicode_literals" // { dg-error "error" } |
| 19 |
#endif |
| 20 |
|
| 21 |
#ifndef __cpp_user_defined_literals |
| 22 |
# error "__cpp_user_defined_literals" // { dg-error "error" } |
| 23 |
#endif |
| 24 |
|
| 25 |
#ifndef __cpp_lambdas |
| 26 |
# error "__cpp_lambdas" // { dg-error "error" } |
| 27 |
#endif |
| 28 |
|
| 29 |
#ifndef __cpp_constexpr |
| 30 |
# error "__cpp_constexpr" // { dg-error "error" } |
| 31 |
#endif |
| 32 |
|
| 33 |
#ifndef __cpp_static_assert |
| 34 |
# error "__cpp_static_assert" // { dg-error "error" } |
| 35 |
#endif |
| 36 |
|
| 37 |
#ifndef __cpp_decltype |
| 38 |
# error "__cpp_decltype" // { dg-error "error" } |
| 39 |
#endif |
| 40 |
|
| 41 |
#ifndef __cpp_attributes |
| 42 |
# error "__cpp_attributes" // { dg-error "error" } |
| 43 |
#endif |
| 44 |
|
| 45 |
#ifndef __cpp_rvalue_references |
| 46 |
# error "__cpp_rvalue_references" // { dg-error "error" } |
| 47 |
#endif |
| 48 |
|
| 49 |
#ifndef __cpp_variadic_templates |
| 50 |
# error "__cpp_variadic_templates" // { dg-error "error" } |
| 51 |
#endif |
| 52 |
|
| 53 |
#ifndef __cpp_initializer_lists |
| 54 |
# error "__cpp_initializer_lists" // { dg-error "error" } |
| 55 |
#endif |
| 56 |
|
| 57 |
#ifndef __cpp_delegating_constructors |
| 58 |
# error "__cpp_delegating_constructors" // { dg-error "error" } |
| 59 |
#endif |
| 60 |
|
| 61 |
#ifndef __cpp_nsdmi |
| 62 |
# error "__cpp_nsdmi" // { dg-error "error" } |
| 63 |
#endif |
| 64 |
|
| 65 |
#ifndef __cpp_inheriting_constructors |
| 66 |
# error "__cpp_inheriting_constructors" // { dg-error "error" } |
| 67 |
#endif |
| 68 |
|
| 69 |
#ifndef __cpp_ref_qualifiers |
| 70 |
# error "__cpp_ref_qualifiers" // { dg-error "error" } |
| 71 |
#endif |
| 72 |
|
| 73 |
#ifndef __cpp_alias_templates |
| 74 |
# error "__cpp_alias_templates" // { dg-error "error" } |
| 75 |
#endif |
| 76 |
|
| 77 |
// C++14 features: |
| 78 |
|
| 79 |
// C++98 gets binary literals in non-ANSI modes. |
| 80 |
//#ifndef __cpp_binary_literals |
| 81 |
//# error "__cpp_binary_literals" |
| 82 |
//#endif |
| 83 |
|
| 84 |
#ifndef __cpp_init_captures |
| 85 |
# error "__cpp_init_captures" // { dg-error "error" } |
| 86 |
#endif |
| 87 |
|
| 88 |
#ifndef __cpp_generic_lambdas |
| 89 |
# error "__cpp_generic_lambdas" // { dg-error "error" } |
| 90 |
#endif |
| 91 |
|
| 92 |
#ifndef __cpp_decltype_auto |
| 93 |
# error "__cpp_decltype_auto" // { dg-error "error" } |
| 94 |
#endif |
| 95 |
|
| 96 |
#ifndef __cpp_return_type_deduction |
| 97 |
# error "__cpp_return_type_deduction" // { dg-error "error" } |
| 98 |
#endif |
| 99 |
|
| 100 |
#ifndef __cpp_aggregate_nsdmi |
| 101 |
# error "__cpp_aggregate_nsdmi" // { dg-error "error" } |
| 102 |
#endif |
| 103 |
|
| 104 |
#ifndef __cpp_variable_templates |
| 105 |
# error "__cpp_variable_templates" // { dg-error "error" } |
| 106 |
#endif |
| 107 |
|
| 108 |
#ifndef __cpp_digit_separators |
| 109 |
# error "__cpp_digit_separators" // { dg-error "error" } |
| 110 |
#endif |
| 111 |
|
| 112 |
#ifndef __cpp_sized_deallocation |
| 113 |
# error "__cpp_sized_deallocation" // { dg-error "error" } |
| 114 |
#endif |
| 115 |
|
| 116 |
// C++17 features: |
| 117 |
|
| 118 |
#ifndef __cpp_namespace_attributes |
| 119 |
# error "__cpp_namespace_attributes" // { dg-error "error" } |
| 120 |
#endif |
| 121 |
|
| 122 |
#ifndef __cpp_nested_namespace_definitions |
| 123 |
# error "__cpp_nested_namespace_definitions" // { dg-error "error" } |
| 124 |
#endif |
| 125 |
|
| 126 |
// C++11 attributes: |
| 127 |
|
| 128 |
#ifdef __has_cpp_attribute |
| 129 |
# if __has_cpp_attribute(noreturn) == 200809 |
| 130 |
# error "__has_cpp_attribute(noreturn) == 200809" // { dg-error "error" } |
| 131 |
# endif |
| 132 |
#else |
| 133 |
# error "__has_cpp_attribute" |
| 134 |
#endif |
| 135 |
|
| 136 |
// Attribute carries_dependency not in yet. |
| 137 |
//#ifdef __has_cpp_attribute |
| 138 |
//# if __has_cpp_attribute(carries_dependency) == 200809 |
| 139 |
//# error "__has_cpp_attribute(carries_dependency) == 200809" // { } |
| 140 |
//# endif |
| 141 |
//#else |
| 142 |
//# error "__has_cpp_attribute" |
| 143 |
//#endif |
| 144 |
|
| 145 |
// C++14 attributes: |
| 146 |
|
| 147 |
// Attribute [[deprecated]] is allowed in C++11 as an extension. |
| 148 |
//#ifdef __has_cpp_attribute |
| 149 |
//# if __has_cpp_attribute(deprecated) == 201309 |
| 150 |
//# error "__has_cpp_attribute(deprecated)" // { } |
| 151 |
//# endif |
| 152 |
//#else |
| 153 |
//# error "__has_cpp_attribute" |
| 154 |
//#endif |