Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++98 -fcxx-exceptions -verify %s |
| 2 | // RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -verify %s |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 3 | // RUN: %clang_cc1 -std=c++14 -fcxx-exceptions -fsized-deallocation -verify %s |
Richard Smith | 20eb9ba | 2018-06-14 00:40:20 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -verify %s |
| 5 | // RUN: %clang_cc1 -std=c++2a -fcxx-exceptions -fsized-deallocation -verify %s |
| 6 | // |
| 7 | // RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -frelaxed-template-template-args -DRELAXED_TEMPLATE_TEMPLATE_ARGS=1 -verify %s |
| 8 | // RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -fconcepts-ts -DCONCEPTS_TS=1 -verify %s |
Tim Northover | 36bb6d5 | 2017-12-09 12:09:54 +0000 | [diff] [blame] | 9 | // RUN: %clang_cc1 -fno-rtti -fno-threadsafe-statics -verify %s -DNO_EXCEPTIONS -DNO_RTTI -DNO_THREADSAFE_STATICS -fsized-deallocation |
| 10 | // RUN: %clang_cc1 -fcoroutines-ts -DNO_EXCEPTIONS -DCOROUTINES -verify -fsized-deallocation %s |
Richard Smith | 3a8244d | 2018-05-01 05:02:45 +0000 | [diff] [blame] | 11 | // RUN: %clang_cc1 -fchar8_t -DNO_EXCEPTIONS -DCHAR8_T -verify -fsized-deallocation %s |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 12 | // RUN: %clang_cc1 -std=c++2a -fno-char8_t -DNO_EXCEPTIONS -DNO_CHAR8_T -verify -fsized-deallocation %s |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 13 | |
| 14 | // expected-no-diagnostics |
| 15 | |
Nico Weber | b2348f4 | 2016-01-19 15:15:31 +0000 | [diff] [blame] | 16 | // FIXME using `defined` in a macro has undefined behavior. |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 17 | #if __cplusplus < 201103L |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 18 | #define check(macro, cxx98, cxx11, cxx14, cxx17, cxx20) (cxx98 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx98) |
JF Bastien | e3c13a8 | 2016-03-22 21:12:48 +0000 | [diff] [blame] | 19 | #elif __cplusplus < 201402L |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 20 | #define check(macro, cxx98, cxx11, cxx14, cxx17, cxx20) (cxx11 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx11) |
| 21 | #elif __cplusplus < 201703L |
| 22 | #define check(macro, cxx98, cxx11, cxx14, cxx17, cxx20) (cxx14 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx14) |
| 23 | #elif __cplusplus <= 201703L |
| 24 | #define check(macro, cxx98, cxx11, cxx14, cxx17, cxx20) (cxx17 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx17) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 25 | #else |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 26 | #define check(macro, cxx98, cxx11, cxx14, cxx17, cxx20) (cxx20 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx20) |
| 27 | #endif |
| 28 | |
| 29 | // --- C++20 features --- |
| 30 | |
| 31 | #if defined(CHAR8_T) ? check(char8_t, 201811, 201811, 201811, 201811, 201811) : \ |
| 32 | defined(NO_CHAR8_T) ? check(char8_t, 0, 0, 0, 0, 0) : \ |
| 33 | check(char8_t, 0, 0, 0, 0, 201811) |
| 34 | #error "wrong value for __cpp_char8_t" |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 35 | #endif |
| 36 | |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 37 | // --- C++17 features --- |
| 38 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 39 | #if check(hex_float, 0, 0, 0, 201603, 201603) |
Richard Smith | 38d91d4 | 2016-09-28 20:26:06 +0000 | [diff] [blame] | 40 | #error "wrong value for __cpp_hex_float" |
| 41 | #endif |
| 42 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 43 | #if check(inline_variables, 0, 0, 0, 201606, 201606) |
Richard Smith | 6e4bedc | 2016-09-28 20:42:56 +0000 | [diff] [blame] | 44 | #error "wrong value for __cpp_inline_variables" |
| 45 | #endif |
| 46 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 47 | #if check(aligned_new, 0, 0, 0, 201606, 201606) |
Richard Smith | 6e4bedc | 2016-09-28 20:42:56 +0000 | [diff] [blame] | 48 | #error "wrong value for __cpp_aligned_new" |
| 49 | #endif |
| 50 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 51 | #if check(guaranteed_copy_elision, 0, 0, 0, 201606, 201606) |
Richard Smith | 20eb9ba | 2018-06-14 00:40:20 +0000 | [diff] [blame] | 52 | #error "wrong value for __cpp_guaranteed_copy_elision" |
| 53 | #endif |
| 54 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 55 | #if check(noexcept_function_type, 0, 0, 0, 201510, 201510) |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 56 | #error "wrong value for __cpp_noexcept_function_type" |
| 57 | #endif |
| 58 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 59 | #if check(fold_expressions, 0, 0, 0, 201603, 201603) |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 60 | #error "wrong value for __cpp_fold_expressions" |
| 61 | #endif |
| 62 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 63 | #if check(capture_star_this, 0, 0, 0, 201603, 201603) |
Richard Smith | 38d91d4 | 2016-09-28 20:26:06 +0000 | [diff] [blame] | 64 | #error "wrong value for __cpp_capture_star_this" |
| 65 | #endif |
| 66 | |
Richard Smith | b80bbca | 2017-02-21 23:58:29 +0000 | [diff] [blame] | 67 | // constexpr checked below |
Richard Smith | 38d91d4 | 2016-09-28 20:26:06 +0000 | [diff] [blame] | 68 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 69 | #if check(if_constexpr, 0, 0, 0, 201606, 201606) |
Richard Smith | 6e4bedc | 2016-09-28 20:42:56 +0000 | [diff] [blame] | 70 | #error "wrong value for __cpp_if_constexpr" |
| 71 | #endif |
| 72 | |
Richard Smith | 38d91d4 | 2016-09-28 20:26:06 +0000 | [diff] [blame] | 73 | // range_based_for checked below |
| 74 | |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 75 | // static_assert checked below |
| 76 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 77 | #if check(deduction_guides, 0, 0, 0, 201703, 201703) |
Richard Smith | adae25d | 2017-07-25 23:31:42 +0000 | [diff] [blame] | 78 | #error "wrong value for __cpp_deduction_guides" |
| 79 | #endif |
| 80 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 81 | #if check(nontype_template_parameter_auto, 0, 0, 0, 201606, 201606) |
Richard Smith | 20eb9ba | 2018-06-14 00:40:20 +0000 | [diff] [blame] | 82 | #error "wrong value for __cpp_nontype_template_parameter_auto" |
| 83 | #endif |
| 84 | |
| 85 | // This is the old name (from P0096R4) for |
| 86 | // __cpp_nontype_template_parameter_auto |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 87 | #if check(template_auto, 0, 0, 0, 201606, 201606) |
Richard Smith | 6e4bedc | 2016-09-28 20:42:56 +0000 | [diff] [blame] | 88 | #error "wrong value for __cpp_template_auto" |
| 89 | #endif |
| 90 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 91 | #if check(namespace_attributes, 0, 0, 0, 201411, 201411) |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 92 | // FIXME: allowed without warning in C++14 and C++11 |
| 93 | #error "wrong value for __cpp_namespace_attributes" |
| 94 | #endif |
| 95 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 96 | #if check(enumerator_attributes, 0, 0, 0, 201411, 201411) |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 97 | // FIXME: allowed without warning in C++14 and C++11 |
| 98 | #error "wrong value for __cpp_enumerator_attributes" |
| 99 | #endif |
| 100 | |
Richard Smith | 20eb9ba | 2018-06-14 00:40:20 +0000 | [diff] [blame] | 101 | // This is an old name (from P0096R4), now removed from SD-6. |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 102 | #if check(nested_namespace_definitions, 0, 0, 0, 201411, 201411) |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 103 | #error "wrong value for __cpp_nested_namespace_definitions" |
| 104 | #endif |
| 105 | |
Richard Smith | dbe74e0 | 2016-12-19 04:21:36 +0000 | [diff] [blame] | 106 | // inheriting_constructors checked below |
| 107 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 108 | #if check(variadic_using, 0, 0, 0, 201611, 201611) |
Richard Smith | adae25d | 2017-07-25 23:31:42 +0000 | [diff] [blame] | 109 | #error "wrong value for __cpp_variadic_using" |
| 110 | #endif |
| 111 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 112 | #if check(aggregate_bases, 0, 0, 0, 201603, 201603) |
Richard Smith | 38d91d4 | 2016-09-28 20:26:06 +0000 | [diff] [blame] | 113 | #error "wrong value for __cpp_aggregate_bases" |
| 114 | #endif |
| 115 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 116 | #if check(structured_bindings, 0, 0, 0, 201606, 201606) |
Richard Smith | dbe74e0 | 2016-12-19 04:21:36 +0000 | [diff] [blame] | 117 | #error "wrong value for __cpp_structured_bindings" |
| 118 | #endif |
Richard Smith | 6e4bedc | 2016-09-28 20:42:56 +0000 | [diff] [blame] | 119 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 120 | #if check(nontype_template_args, 0, 0, 0, 201411, 201411) |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 121 | #error "wrong value for __cpp_nontype_template_args" |
| 122 | #endif |
| 123 | |
Richard Smith | 20eb9ba | 2018-06-14 00:40:20 +0000 | [diff] [blame] | 124 | #if defined(RELAXED_TEMPLATE_TEMPLATE_ARGS) \ |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 125 | ? check(template_template_args, 0, 0, 0, 201611, 201611) \ |
| 126 | : check(template_template_args, 0, 0, 0, 0, 0) |
Richard Smith | cbe0793 | 2017-02-14 00:55:25 +0000 | [diff] [blame] | 127 | #error "wrong value for __cpp_template_template_args" |
| 128 | #endif |
| 129 | |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 130 | // --- C++14 features --- |
| 131 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 132 | #if check(binary_literals, 0, 0, 201304, 201304, 201304) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 133 | #error "wrong value for __cpp_binary_literals" |
| 134 | #endif |
| 135 | |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 136 | // (Removed from SD-6.) |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 137 | #if check(digit_separators, 0, 0, 201309, 201309, 201309) |
Richard Smith | 38af856 | 2014-11-12 21:16:38 +0000 | [diff] [blame] | 138 | #error "wrong value for __cpp_digit_separators" |
| 139 | #endif |
| 140 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 141 | #if check(init_captures, 0, 0, 201304, 201304, 201304) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 142 | #error "wrong value for __cpp_init_captures" |
| 143 | #endif |
| 144 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 145 | #if check(generic_lambdas, 0, 0, 201304, 201304, 201304) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 146 | #error "wrong value for __cpp_generic_lambdas" |
| 147 | #endif |
| 148 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 149 | #if check(sized_deallocation, 0, 0, 201309, 201309, 201309) |
Richard Smith | 38af856 | 2014-11-12 21:16:38 +0000 | [diff] [blame] | 150 | #error "wrong value for __cpp_sized_deallocation" |
| 151 | #endif |
| 152 | |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 153 | // constexpr checked below |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 154 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 155 | #if check(decltype_auto, 0, 0, 201304, 201304, 201304) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 156 | #error "wrong value for __cpp_decltype_auto" |
| 157 | #endif |
| 158 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 159 | #if check(return_type_deduction, 0, 0, 201304, 201304, 201304) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 160 | #error "wrong value for __cpp_return_type_deduction" |
| 161 | #endif |
| 162 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 163 | #if check(runtime_arrays, 0, 0, 0, 0, 0) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 164 | #error "wrong value for __cpp_runtime_arrays" |
| 165 | #endif |
| 166 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 167 | #if check(aggregate_nsdmi, 0, 0, 201304, 201304, 201304) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 168 | #error "wrong value for __cpp_aggregate_nsdmi" |
| 169 | #endif |
| 170 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 171 | #if check(variable_templates, 0, 0, 201304, 201304, 201304) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 172 | #error "wrong value for __cpp_variable_templates" |
| 173 | #endif |
| 174 | |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 175 | // --- C++11 features --- |
| 176 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 177 | #if check(unicode_characters, 0, 200704, 200704, 200704, 200704) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 178 | #error "wrong value for __cpp_unicode_characters" |
| 179 | #endif |
| 180 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 181 | #if check(raw_strings, 0, 200710, 200710, 200710, 200710) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 182 | #error "wrong value for __cpp_raw_strings" |
| 183 | #endif |
| 184 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 185 | #if check(unicode_literals, 0, 200710, 200710, 200710, 200710) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 186 | #error "wrong value for __cpp_unicode_literals" |
| 187 | #endif |
| 188 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 189 | #if check(user_defined_literals, 0, 200809, 200809, 200809, 200809) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 190 | #error "wrong value for __cpp_user_defined_literals" |
| 191 | #endif |
| 192 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 193 | #if defined(NO_THREADSAFE_STATICS) ? check(threadsafe_static_init, 0, 0, 0, 0, 0) : \ |
| 194 | check(threadsafe_static_init, 200806, 200806, 200806, 200806, 200806) |
Richard Smith | 9d07ae7 | 2017-08-11 03:39:40 +0000 | [diff] [blame] | 195 | #error "wrong value for __cpp_threadsafe_static_init" |
| 196 | #endif |
| 197 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 198 | #if check(lambdas, 0, 200907, 200907, 200907, 200907) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 199 | #error "wrong value for __cpp_lambdas" |
| 200 | #endif |
| 201 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 202 | #if check(constexpr, 0, 200704, 201304, 201603, 201603) |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 203 | #error "wrong value for __cpp_constexpr" |
| 204 | #endif |
| 205 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 206 | #if check(range_based_for, 0, 200907, 200907, 201603, 201603) |
Richard Smith | 38af856 | 2014-11-12 21:16:38 +0000 | [diff] [blame] | 207 | #error "wrong value for __cpp_range_based_for" |
| 208 | #endif |
| 209 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 210 | #if check(static_assert, 0, 200410, 200410, 201411, 201411) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 211 | #error "wrong value for __cpp_static_assert" |
| 212 | #endif |
| 213 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 214 | #if check(decltype, 0, 200707, 200707, 200707, 200707) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 215 | #error "wrong value for __cpp_decltype" |
| 216 | #endif |
| 217 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 218 | #if check(attributes, 0, 200809, 200809, 200809, 200809) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 219 | #error "wrong value for __cpp_attributes" |
| 220 | #endif |
| 221 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 222 | #if check(rvalue_references, 0, 200610, 200610, 200610, 200610) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 223 | #error "wrong value for __cpp_rvalue_references" |
| 224 | #endif |
| 225 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 226 | #if check(variadic_templates, 0, 200704, 200704, 200704, 200704) |
Richard Smith | 91e474f | 2013-11-27 22:58:16 +0000 | [diff] [blame] | 227 | #error "wrong value for __cpp_variadic_templates" |
| 228 | #endif |
Richard Smith | 38af856 | 2014-11-12 21:16:38 +0000 | [diff] [blame] | 229 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 230 | #if check(initializer_lists, 0, 200806, 200806, 200806, 200806) |
Richard Smith | 38af856 | 2014-11-12 21:16:38 +0000 | [diff] [blame] | 231 | #error "wrong value for __cpp_initializer_lists" |
| 232 | #endif |
| 233 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 234 | #if check(delegating_constructors, 0, 200604, 200604, 200604, 200604) |
Richard Smith | 38af856 | 2014-11-12 21:16:38 +0000 | [diff] [blame] | 235 | #error "wrong value for __cpp_delegating_constructors" |
| 236 | #endif |
| 237 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 238 | #if check(nsdmi, 0, 200809, 200809, 200809, 200809) |
Richard Smith | 38af856 | 2014-11-12 21:16:38 +0000 | [diff] [blame] | 239 | #error "wrong value for __cpp_nsdmi" |
| 240 | #endif |
| 241 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 242 | #if check(inheriting_constructors, 0, 201511, 201511, 201511, 201511) |
Richard Smith | 38af856 | 2014-11-12 21:16:38 +0000 | [diff] [blame] | 243 | #error "wrong value for __cpp_inheriting_constructors" |
| 244 | #endif |
| 245 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 246 | #if check(ref_qualifiers, 0, 200710, 200710, 200710, 200710) |
Richard Smith | 38af856 | 2014-11-12 21:16:38 +0000 | [diff] [blame] | 247 | #error "wrong value for __cpp_ref_qualifiers" |
| 248 | #endif |
| 249 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 250 | #if check(alias_templates, 0, 200704, 200704, 200704, 200704) |
Richard Smith | 38af856 | 2014-11-12 21:16:38 +0000 | [diff] [blame] | 251 | #error "wrong value for __cpp_alias_templates" |
| 252 | #endif |
Faisal Vali | 24d59d1 | 2015-05-22 01:11:10 +0000 | [diff] [blame] | 253 | |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 254 | // --- C++98 features --- |
| 255 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 256 | #if defined(NO_RTTI) ? check(rtti, 0, 0, 0, 0, 0) : check(rtti, 199711, 199711, 199711, 199711, 199711) |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 257 | #error "wrong value for __cpp_rtti" |
| 258 | #endif |
| 259 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 260 | #if defined(NO_EXCEPTIONS) ? check(exceptions, 0, 0, 0, 0, 0) : check(exceptions, 199711, 199711, 199711, 199711, 199711) |
Richard Smith | b02043c | 2016-09-28 19:44:50 +0000 | [diff] [blame] | 261 | #error "wrong value for __cpp_exceptions" |
| 262 | #endif |
| 263 | |
| 264 | // --- TS features -- |
| 265 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 266 | #if check(experimental_concepts, 0, 0, CONCEPTS_TS, CONCEPTS_TS, CONCEPTS_TS) |
Faisal Vali | 24d59d1 | 2015-05-22 01:11:10 +0000 | [diff] [blame] | 267 | #error "wrong value for __cpp_experimental_concepts" |
| 268 | #endif |
Richard Smith | 3fa73f3 | 2015-10-22 04:27:47 +0000 | [diff] [blame] | 269 | |
Richard Smith | 28ddb91 | 2018-11-14 21:04:34 +0000 | [diff] [blame] | 270 | #if defined(COROUTINES) ? check(coroutines, 201703L, 201703L, 201703L, 201703L, 201703L) : check(coroutines, 0, 0, 0, 0, 0) |
Richard Smith | 3fa73f3 | 2015-10-22 04:27:47 +0000 | [diff] [blame] | 271 | #error "wrong value for __cpp_coroutines" |
| 272 | #endif |