Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-11 %s |
Douglas Gregor | a7130bf | 2013-05-02 05:28:32 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -E -triple armv7-apple-darwin -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-NO-TLS %s |
Yunzhong Gao | 7704ba7 | 2015-08-01 02:55:59 +0000 | [diff] [blame] | 3 | // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++98 %s -o - | FileCheck --check-prefix=CHECK-NO-11 %s |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++14 %s -o - | FileCheck --check-prefix=CHECK-14 %s |
| 5 | // RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c++1z %s -o - | FileCheck --check-prefix=CHECK-1Z %s |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 6 | |
David Chisnall | fa35df6 | 2012-01-16 17:27:18 +0000 | [diff] [blame] | 7 | #if __has_feature(cxx_atomic) |
| 8 | int has_atomic(); |
| 9 | #else |
| 10 | int no_atomic(); |
| 11 | #endif |
| 12 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 13 | // CHECK-1Z: has_atomic |
| 14 | // CHECK-14: has_atomic |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 15 | // CHECK-11: has_atomic |
| 16 | // CHECK-NO-11: no_atomic |
David Chisnall | fa35df6 | 2012-01-16 17:27:18 +0000 | [diff] [blame] | 17 | |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 18 | #if __has_feature(cxx_lambdas) |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 19 | int has_lambdas(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 20 | #else |
| 21 | int no_lambdas(); |
| 22 | #endif |
| 23 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 24 | // CHECK-1Z: has_lambdas |
| 25 | // CHECK-14: has_lambdas |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 26 | // CHECK-11: has_lambdas |
| 27 | // CHECK-NO-11: no_lambdas |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 28 | |
| 29 | |
| 30 | #if __has_feature(cxx_nullptr) |
Alexis Hunt | 10e2f72 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 31 | int has_nullptr(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 32 | #else |
| 33 | int no_nullptr(); |
| 34 | #endif |
| 35 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 36 | // CHECK-1Z: has_nullptr |
| 37 | // CHECK-14: has_nullptr |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 38 | // CHECK-11: has_nullptr |
| 39 | // CHECK-NO-11: no_nullptr |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 40 | |
| 41 | |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 42 | #if __has_feature(cxx_decltype) |
Alexis Hunt | 10e2f72 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 43 | int has_decltype(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 44 | #else |
| 45 | int no_decltype(); |
| 46 | #endif |
| 47 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 48 | // CHECK-1Z: has_decltype |
| 49 | // CHECK-14: has_decltype |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 50 | // CHECK-11: has_decltype |
| 51 | // CHECK-NO-11: no_decltype |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 52 | |
| 53 | |
Douglas Gregor | 0598962 | 2012-04-10 20:00:33 +0000 | [diff] [blame] | 54 | #if __has_feature(cxx_decltype_incomplete_return_types) |
| 55 | int has_decltype_incomplete_return_types(); |
| 56 | #else |
| 57 | int no_decltype_incomplete_return_types(); |
| 58 | #endif |
| 59 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 60 | // CHECK-1Z: has_decltype_incomplete_return_types |
| 61 | // CHECK-14: has_decltype_incomplete_return_types |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 62 | // CHECK-11: has_decltype_incomplete_return_types |
| 63 | // CHECK-NO-11: no_decltype_incomplete_return_types |
Douglas Gregor | 0598962 | 2012-04-10 20:00:33 +0000 | [diff] [blame] | 64 | |
| 65 | |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 66 | #if __has_feature(cxx_auto_type) |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 67 | int has_auto_type(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 68 | #else |
| 69 | int no_auto_type(); |
| 70 | #endif |
| 71 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 72 | // CHECK-1Z: has_auto_type |
| 73 | // CHECK-14: has_auto_type |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 74 | // CHECK-11: has_auto_type |
| 75 | // CHECK-NO-11: no_auto_type |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 76 | |
| 77 | |
Richard Smith | 13f68cf | 2011-04-03 14:12:46 +0000 | [diff] [blame] | 78 | #if __has_feature(cxx_trailing_return) |
| 79 | int has_trailing_return(); |
| 80 | #else |
| 81 | int no_trailing_return(); |
| 82 | #endif |
| 83 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 84 | // CHECK-1Z: has_trailing_return |
| 85 | // CHECK-14: has_trailing_return |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 86 | // CHECK-11: has_trailing_return |
| 87 | // CHECK-NO-11: no_trailing_return |
Richard Smith | 13f68cf | 2011-04-03 14:12:46 +0000 | [diff] [blame] | 88 | |
| 89 | |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 90 | #if __has_feature(cxx_attributes) |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 91 | int has_attributes(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 92 | #else |
| 93 | int no_attributes(); |
| 94 | #endif |
| 95 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 96 | // CHECK-1Z: has_attributes |
| 97 | // CHECK-14: has_attributes |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 98 | // CHECK-11: has_attributes |
| 99 | // CHECK-NO-11: no_attributes |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 100 | |
| 101 | |
| 102 | #if __has_feature(cxx_static_assert) |
Alexis Hunt | 10e2f72 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 103 | int has_static_assert(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 104 | #else |
| 105 | int no_static_assert(); |
| 106 | #endif |
| 107 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 108 | // CHECK-1Z: has_static_assert |
| 109 | // CHECK-14: has_static_assert |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 110 | // CHECK-11: has_static_assert |
| 111 | // CHECK-NO-11: no_static_assert |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 112 | |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 113 | #if __has_feature(cxx_deleted_functions) |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 114 | int has_deleted_functions(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 115 | #else |
| 116 | int no_deleted_functions(); |
| 117 | #endif |
| 118 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 119 | // CHECK-1Z: has_deleted_functions |
| 120 | // CHECK-14: has_deleted_functions |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 121 | // CHECK-11: has_deleted_functions |
| 122 | // CHECK-NO-11: no_deleted_functions |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 123 | |
Douglas Gregor | 3c46976 | 2011-11-01 01:19:34 +0000 | [diff] [blame] | 124 | #if __has_feature(cxx_defaulted_functions) |
| 125 | int has_defaulted_functions(); |
| 126 | #else |
| 127 | int no_defaulted_functions(); |
| 128 | #endif |
| 129 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 130 | // CHECK-1Z: has_defaulted_functions |
| 131 | // CHECK-14: has_defaulted_functions |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 132 | // CHECK-11: has_defaulted_functions |
| 133 | // CHECK-NO-11: no_defaulted_functions |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 134 | |
| 135 | #if __has_feature(cxx_rvalue_references) |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 136 | int has_rvalue_references(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 137 | #else |
| 138 | int no_rvalue_references(); |
| 139 | #endif |
| 140 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 141 | // CHECK-1Z: has_rvalue_references |
| 142 | // CHECK-14: has_rvalue_references |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 143 | // CHECK-11: has_rvalue_references |
| 144 | // CHECK-NO-11: no_rvalue_references |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 145 | |
| 146 | |
| 147 | #if __has_feature(cxx_variadic_templates) |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 148 | int has_variadic_templates(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 149 | #else |
| 150 | int no_variadic_templates(); |
| 151 | #endif |
| 152 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 153 | // CHECK-1Z: has_variadic_templates |
| 154 | // CHECK-14: has_variadic_templates |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 155 | // CHECK-11: has_variadic_templates |
| 156 | // CHECK-NO-11: no_variadic_templates |
Sebastian Redl | a93bb5b | 2010-08-31 23:28:47 +0000 | [diff] [blame] | 157 | |
| 158 | |
| 159 | #if __has_feature(cxx_inline_namespaces) |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 160 | int has_inline_namespaces(); |
Sebastian Redl | a93bb5b | 2010-08-31 23:28:47 +0000 | [diff] [blame] | 161 | #else |
| 162 | int no_inline_namespaces(); |
| 163 | #endif |
| 164 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 165 | // CHECK-1Z: has_inline_namespaces |
| 166 | // CHECK-14: has_inline_namespaces |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 167 | // CHECK-11: has_inline_namespaces |
| 168 | // CHECK-NO-11: no_inline_namespaces |
Douglas Gregor | 56d5f0a | 2011-01-26 21:25:54 +0000 | [diff] [blame] | 169 | |
Richard Smith | 9bc6eed | 2011-04-15 15:14:40 +0000 | [diff] [blame] | 170 | |
| 171 | #if __has_feature(cxx_range_for) |
| 172 | int has_range_for(); |
| 173 | #else |
| 174 | int no_range_for(); |
| 175 | #endif |
| 176 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 177 | // CHECK-1Z: has_range_for |
| 178 | // CHECK-14: has_range_for |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 179 | // CHECK-11: has_range_for |
| 180 | // CHECK-NO-11: no_range_for |
Richard Smith | 9bc6eed | 2011-04-15 15:14:40 +0000 | [diff] [blame] | 181 | |
| 182 | |
Douglas Gregor | 56d5f0a | 2011-01-26 21:25:54 +0000 | [diff] [blame] | 183 | #if __has_feature(cxx_reference_qualified_functions) |
| 184 | int has_reference_qualified_functions(); |
| 185 | #else |
| 186 | int no_reference_qualified_functions(); |
| 187 | #endif |
| 188 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 189 | // CHECK-1Z: has_reference_qualified_functions |
| 190 | // CHECK-14: has_reference_qualified_functions |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 191 | // CHECK-11: has_reference_qualified_functions |
| 192 | // CHECK-NO-11: no_reference_qualified_functions |
Douglas Gregor | 56d5f0a | 2011-01-26 21:25:54 +0000 | [diff] [blame] | 193 | |
Douglas Gregor | 7115aee | 2011-02-05 20:35:30 +0000 | [diff] [blame] | 194 | #if __has_feature(cxx_default_function_template_args) |
| 195 | int has_default_function_template_args(); |
| 196 | #else |
| 197 | int no_default_function_template_args(); |
| 198 | #endif |
| 199 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 200 | // CHECK-1Z: has_default_function_template_args |
| 201 | // CHECK-14: has_default_function_template_args |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 202 | // CHECK-11: has_default_function_template_args |
| 203 | // CHECK-NO-11: no_default_function_template_args |
Douglas Gregor | 7115aee | 2011-02-05 20:35:30 +0000 | [diff] [blame] | 204 | |
Sebastian Redl | c17003c | 2011-03-15 21:17:12 +0000 | [diff] [blame] | 205 | #if __has_feature(cxx_noexcept) |
| 206 | int has_noexcept(); |
| 207 | #else |
| 208 | int no_noexcept(); |
| 209 | #endif |
| 210 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 211 | // CHECK-1Z: has_noexcept |
| 212 | // CHECK-14: has_noexcept |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 213 | // CHECK-11: has_noexcept |
| 214 | // CHECK-NO-11: no_noexcept |
Sebastian Redl | c17003c | 2011-03-15 21:17:12 +0000 | [diff] [blame] | 215 | |
Anders Carlsson | 69f1f93 | 2011-03-25 15:04:23 +0000 | [diff] [blame] | 216 | #if __has_feature(cxx_override_control) |
| 217 | int has_override_control(); |
| 218 | #else |
| 219 | int no_override_control(); |
| 220 | #endif |
| 221 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 222 | // CHECK-1Z: has_override_control |
| 223 | // CHECK-14: has_override_control |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 224 | // CHECK-11: has_override_control |
| 225 | // CHECK-NO-11: no_override_control |
Richard Smith | 3f1b5d0 | 2011-05-05 21:57:07 +0000 | [diff] [blame] | 226 | |
| 227 | #if __has_feature(cxx_alias_templates) |
| 228 | int has_alias_templates(); |
| 229 | #else |
| 230 | int no_alias_templates(); |
| 231 | #endif |
| 232 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 233 | // CHECK-1Z: has_alias_templates |
| 234 | // CHECK-14: has_alias_templates |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 235 | // CHECK-11: has_alias_templates |
| 236 | // CHECK-NO-11: no_alias_templates |
Sebastian Redl | e9c4e84 | 2011-09-04 18:14:28 +0000 | [diff] [blame] | 237 | |
| 238 | #if __has_feature(cxx_implicit_moves) |
| 239 | int has_implicit_moves(); |
| 240 | #else |
| 241 | int no_implicit_moves(); |
| 242 | #endif |
| 243 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 244 | // CHECK-1Z: has_implicit_moves |
| 245 | // CHECK-14: has_implicit_moves |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 246 | // CHECK-11: has_implicit_moves |
| 247 | // CHECK-NO-11: no_implicit_moves |
Peter Collingbourne | 60188eb | 2011-10-14 23:44:46 +0000 | [diff] [blame] | 248 | |
| 249 | #if __has_feature(cxx_alignas) |
| 250 | int has_alignas(); |
| 251 | #else |
| 252 | int no_alignas(); |
| 253 | #endif |
| 254 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 255 | // CHECK-1Z: has_alignas |
| 256 | // CHECK-14: has_alignas |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 257 | // CHECK-11: has_alignas |
| 258 | // CHECK-NO-11: no_alignas |
Douglas Gregor | a7efb88 | 2011-11-01 01:23:44 +0000 | [diff] [blame] | 259 | |
Nico Weber | 736a993 | 2014-12-03 01:25:49 +0000 | [diff] [blame] | 260 | #if __has_feature(cxx_alignof) |
| 261 | int has_alignof(); |
| 262 | #else |
| 263 | int no_alignof(); |
| 264 | #endif |
| 265 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 266 | // CHECK-1Z: has_alignof |
| 267 | // CHECK-14: has_alignof |
Nico Weber | 736a993 | 2014-12-03 01:25:49 +0000 | [diff] [blame] | 268 | // CHECK-11: has_alignof |
| 269 | // CHECK-NO-11: no_alignof |
| 270 | |
Douglas Gregor | a7efb88 | 2011-11-01 01:23:44 +0000 | [diff] [blame] | 271 | #if __has_feature(cxx_raw_string_literals) |
| 272 | int has_raw_string_literals(); |
| 273 | #else |
| 274 | int no_raw_string_literals(); |
| 275 | #endif |
| 276 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 277 | // CHECK-1Z: has_raw_string_literals |
| 278 | // CHECK-14: has_raw_string_literals |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 279 | // CHECK-11: has_raw_string_literals |
| 280 | // CHECK-NO-11: no_raw_string_literals |
Douglas Gregor | a7efb88 | 2011-11-01 01:23:44 +0000 | [diff] [blame] | 281 | |
| 282 | #if __has_feature(cxx_unicode_literals) |
| 283 | int has_unicode_literals(); |
| 284 | #else |
| 285 | int no_unicode_literals(); |
| 286 | #endif |
| 287 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 288 | // CHECK-1Z: has_unicode_literals |
| 289 | // CHECK-14: has_unicode_literals |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 290 | // CHECK-11: has_unicode_literals |
| 291 | // CHECK-NO-11: no_unicode_literals |
Richard Smith | 1cb2af0 | 2012-02-14 22:56:17 +0000 | [diff] [blame] | 292 | |
| 293 | #if __has_feature(cxx_constexpr) |
| 294 | int has_constexpr(); |
| 295 | #else |
| 296 | int no_constexpr(); |
| 297 | #endif |
| 298 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 299 | // CHECK-1Z: has_constexpr |
| 300 | // CHECK-14: has_constexpr |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 301 | // CHECK-11: has_constexpr |
| 302 | // CHECK-NO-11: no_constexpr |
Sebastian Redl | d89c218 | 2012-02-25 20:51:27 +0000 | [diff] [blame] | 303 | |
Richard Smith | 5e29dd3 | 2017-01-20 00:45:35 +0000 | [diff] [blame] | 304 | #if __has_feature(cxx_constexpr_string_builtins) |
| 305 | int has_constexpr_string_builtins(); |
| 306 | #else |
| 307 | int no_constexpr_string_builtins(); |
| 308 | #endif |
| 309 | |
| 310 | // CHECK-1Z: has_constexpr_string_builtins |
| 311 | // CHECK-14: has_constexpr_string_builtins |
| 312 | // CHECK-11: has_constexpr_string_builtins |
| 313 | // CHECK-NO-11: no_constexpr_string_builtins |
| 314 | |
Sebastian Redl | d89c218 | 2012-02-25 20:51:27 +0000 | [diff] [blame] | 315 | #if __has_feature(cxx_generalized_initializers) |
| 316 | int has_generalized_initializers(); |
| 317 | #else |
| 318 | int no_generalized_initializers(); |
| 319 | #endif |
| 320 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 321 | // CHECK-1Z: has_generalized_initializers |
| 322 | // CHECK-14: has_generalized_initializers |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 323 | // CHECK-11: has_generalized_initializers |
| 324 | // CHECK-NO-11: no_generalized_initializers |
Richard Smith | 522fa53 | 2012-03-03 23:51:05 +0000 | [diff] [blame] | 325 | |
| 326 | #if __has_feature(cxx_unrestricted_unions) |
| 327 | int has_unrestricted_unions(); |
| 328 | #else |
| 329 | int no_unrestricted_unions(); |
| 330 | #endif |
| 331 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 332 | // CHECK-1Z: has_unrestricted_unions |
| 333 | // CHECK-14: has_unrestricted_unions |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 334 | // CHECK-11: has_unrestricted_unions |
| 335 | // CHECK-NO-11: no_unrestricted_unions |
Richard Smith | 5023188 | 2012-03-09 08:41:27 +0000 | [diff] [blame] | 336 | |
| 337 | #if __has_feature(cxx_user_literals) |
| 338 | int has_user_literals(); |
| 339 | #else |
| 340 | int no_user_literals(); |
| 341 | #endif |
| 342 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 343 | // CHECK-1Z: has_user_literals |
| 344 | // CHECK-14: has_user_literals |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 345 | // CHECK-11: has_user_literals |
| 346 | // CHECK-NO-11: no_user_literals |
Douglas Gregor | 9781893 | 2012-04-04 00:48:39 +0000 | [diff] [blame] | 347 | |
| 348 | #if __has_feature(cxx_local_type_template_args) |
| 349 | int has_local_type_template_args(); |
| 350 | #else |
| 351 | int no_local_type_template_args(); |
| 352 | #endif |
| 353 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 354 | // CHECK-1Z: has_local_type_template_args |
| 355 | // CHECK-14: has_local_type_template_args |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 356 | // CHECK-11: has_local_type_template_args |
| 357 | // CHECK-NO-11: no_local_type_template_args |
Richard Smith | 25b555a | 2013-04-19 17:00:31 +0000 | [diff] [blame] | 358 | |
| 359 | #if __has_feature(cxx_inheriting_constructors) |
| 360 | int has_inheriting_constructors(); |
| 361 | #else |
| 362 | int no_inheriting_constructors(); |
| 363 | #endif |
| 364 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 365 | // CHECK-1Z: has_inheriting_constructors |
| 366 | // CHECK-14: has_inheriting_constructors |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 367 | // CHECK-11: has_inheriting_constructors |
| 368 | // CHECK-NO-11: no_inheriting_constructors |
Richard Smith | 25b555a | 2013-04-19 17:00:31 +0000 | [diff] [blame] | 369 | |
| 370 | #if __has_feature(cxx_thread_local) |
| 371 | int has_thread_local(); |
| 372 | #else |
| 373 | int no_thread_local(); |
| 374 | #endif |
| 375 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 376 | // CHECK-1Z: has_thread_local |
| 377 | // CHECK-14: has_thread_local |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 378 | // CHECK-11: has_thread_local |
| 379 | // CHECK-NO-11: no_thread_local |
Douglas Gregor | a7130bf | 2013-05-02 05:28:32 +0000 | [diff] [blame] | 380 | // CHECK-NO-TLS: no_thread_local |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 381 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 382 | // === C++14 features === |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 383 | |
| 384 | #if __has_feature(cxx_binary_literals) |
| 385 | int has_binary_literals(); |
| 386 | #else |
| 387 | int no_binary_literals(); |
| 388 | #endif |
| 389 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 390 | // CHECK-1Z: has_binary_literals |
| 391 | // CHECK-14: has_binary_literals |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 392 | // CHECK-11: no_binary_literals |
| 393 | // CHECK-NO-11: no_binary_literals |
| 394 | |
| 395 | #if __has_feature(cxx_aggregate_nsdmi) |
| 396 | int has_aggregate_nsdmi(); |
| 397 | #else |
| 398 | int no_aggregate_nsdmi(); |
| 399 | #endif |
| 400 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 401 | // CHECK-1Z: has_aggregate_nsdmi |
| 402 | // CHECK-14: has_aggregate_nsdmi |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 403 | // CHECK-11: no_aggregate_nsdmi |
| 404 | // CHECK-NO-11: no_aggregate_nsdmi |
Richard Smith | 9155be1 | 2013-05-12 03:09:35 +0000 | [diff] [blame] | 405 | |
| 406 | #if __has_feature(cxx_return_type_deduction) |
| 407 | int has_return_type_deduction(); |
| 408 | #else |
| 409 | int no_return_type_deduction(); |
| 410 | #endif |
| 411 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 412 | // CHECK-1Z: has_return_type_deduction |
| 413 | // CHECK-14: has_return_type_deduction |
Richard Smith | 9155be1 | 2013-05-12 03:09:35 +0000 | [diff] [blame] | 414 | // CHECK-11: no_return_type_deduction |
| 415 | // CHECK-NO-11: no_return_type_deduction |
Richard Smith | c0f7b81 | 2013-07-24 17:41:31 +0000 | [diff] [blame] | 416 | |
| 417 | #if __has_feature(cxx_contextual_conversions) |
| 418 | int has_contextual_conversions(); |
| 419 | #else |
| 420 | int no_contextual_conversions(); |
| 421 | #endif |
| 422 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 423 | // CHECK-1Z: has_contextual_conversions |
| 424 | // CHECK-14: has_contextual_conversions |
Richard Smith | c0f7b81 | 2013-07-24 17:41:31 +0000 | [diff] [blame] | 425 | // CHECK-11: no_contextual_conversions |
| 426 | // CHECK-NO-11: no_contextual_conversions |
| 427 | |
| 428 | #if __has_feature(cxx_relaxed_constexpr) |
| 429 | int has_relaxed_constexpr(); |
| 430 | #else |
| 431 | int no_relaxed_constexpr(); |
| 432 | #endif |
| 433 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 434 | // CHECK-1Z: has_relaxed_constexpr |
| 435 | // CHECK-14: has_relaxed_constexpr |
Richard Smith | c0f7b81 | 2013-07-24 17:41:31 +0000 | [diff] [blame] | 436 | // CHECK-11: no_relaxed_constexpr |
| 437 | // CHECK-NO-11: no_relaxed_constexpr |
Richard Smith | dca0c7a | 2013-09-27 20:19:41 +0000 | [diff] [blame] | 438 | |
| 439 | #if __has_feature(cxx_variable_templates) |
| 440 | int has_variable_templates(); |
| 441 | #else |
| 442 | int no_variable_templates(); |
| 443 | #endif |
| 444 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 445 | // CHECK-1Z: has_variable_templates |
| 446 | // CHECK-14: has_variable_templates |
Richard Smith | dca0c7a | 2013-09-27 20:19:41 +0000 | [diff] [blame] | 447 | // CHECK-11: no_variable_templates |
| 448 | // CHECK-NO-11: no_variable_templates |
Richard Smith | b438e62 | 2013-09-28 04:37:56 +0000 | [diff] [blame] | 449 | |
| 450 | #if __has_feature(cxx_init_captures) |
| 451 | int has_init_captures(); |
| 452 | #else |
| 453 | int no_init_captures(); |
| 454 | #endif |
| 455 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 456 | // CHECK-1Z: has_init_captures |
| 457 | // CHECK-14: has_init_captures |
Richard Smith | b438e62 | 2013-09-28 04:37:56 +0000 | [diff] [blame] | 458 | // CHECK-11: no_init_captures |
| 459 | // CHECK-NO-11: no_init_captures |
Richard Smith | 6d54014 | 2014-05-09 21:08:59 +0000 | [diff] [blame] | 460 | |
| 461 | #if __has_feature(cxx_decltype_auto) |
| 462 | int has_decltype_auto(); |
| 463 | #else |
| 464 | int no_decltype_auto(); |
| 465 | #endif |
| 466 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 467 | // CHECK-1Z: has_decltype_auto |
| 468 | // CHECK-14: has_decltype_auto |
Richard Smith | 6d54014 | 2014-05-09 21:08:59 +0000 | [diff] [blame] | 469 | // CHECK-11: no_decltype_auto |
| 470 | // CHECK-NO-11: no_decltype_auto |
| 471 | |
| 472 | #if __has_feature(cxx_generic_lambdas) |
| 473 | int has_generic_lambdas(); |
| 474 | #else |
| 475 | int no_generic_lambdas(); |
| 476 | #endif |
| 477 | |
Faisal Vali | 2933621 | 2015-05-22 02:57:28 +0000 | [diff] [blame] | 478 | // CHECK-1Z: has_generic_lambdas |
| 479 | // CHECK-14: has_generic_lambdas |
Richard Smith | 6d54014 | 2014-05-09 21:08:59 +0000 | [diff] [blame] | 480 | // CHECK-11: no_generic_lambdas |
| 481 | // CHECK-NO-11: no_generic_lambdas |