Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -E -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-0X %s |
Daniel Dunbar | 9fde9c4 | 2010-06-29 16:52:24 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-0X %s |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 3 | |
David Chisnall | 7a7ee30 | 2012-01-16 17:27:18 +0000 | [diff] [blame] | 4 | #if __has_feature(cxx_atomic) |
| 5 | int has_atomic(); |
| 6 | #else |
| 7 | int no_atomic(); |
| 8 | #endif |
| 9 | |
| 10 | // CHECK-0X: has_atomic |
| 11 | // CHECK-NO-0X: no_atomic |
| 12 | |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 13 | #if __has_feature(cxx_lambdas) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 14 | int has_lambdas(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 15 | #else |
| 16 | int no_lambdas(); |
| 17 | #endif |
| 18 | |
Douglas Gregor | 7c07e96 | 2012-02-23 03:02:32 +0000 | [diff] [blame] | 19 | // CHECK-0X: has_lambdas |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 20 | // CHECK-NO-0X: no_lambdas |
| 21 | |
| 22 | |
| 23 | #if __has_feature(cxx_nullptr) |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 24 | int has_nullptr(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 25 | #else |
| 26 | int no_nullptr(); |
| 27 | #endif |
| 28 | |
Douglas Gregor | 84ee2ee | 2011-05-21 23:15:46 +0000 | [diff] [blame] | 29 | // CHECK-0X: has_nullptr |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 30 | // CHECK-NO-0X: no_nullptr |
| 31 | |
| 32 | |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 33 | #if __has_feature(cxx_decltype) |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 34 | int has_decltype(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 35 | #else |
| 36 | int no_decltype(); |
| 37 | #endif |
| 38 | |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 39 | // CHECK-0X: has_decltype |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 40 | // CHECK-NO-0X: no_decltype |
| 41 | |
| 42 | |
Douglas Gregor | 316551f | 2012-04-10 20:00:33 +0000 | [diff] [blame] | 43 | #if __has_feature(cxx_decltype_incomplete_return_types) |
| 44 | int has_decltype_incomplete_return_types(); |
| 45 | #else |
| 46 | int no_decltype_incomplete_return_types(); |
| 47 | #endif |
| 48 | |
| 49 | // CHECK-0X: has_decltype_incomplete_return_types |
| 50 | // CHECK-NO-0X: no_decltype_incomplete_return_types |
| 51 | |
| 52 | |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 53 | #if __has_feature(cxx_auto_type) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 54 | int has_auto_type(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 55 | #else |
| 56 | int no_auto_type(); |
| 57 | #endif |
| 58 | |
Richard Smith | 738291e | 2011-02-20 12:13:05 +0000 | [diff] [blame] | 59 | // CHECK-0X: has_auto_type |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 60 | // CHECK-NO-0X: no_auto_type |
| 61 | |
| 62 | |
Richard Smith | 6a4e73c | 2011-04-03 14:12:46 +0000 | [diff] [blame] | 63 | #if __has_feature(cxx_trailing_return) |
| 64 | int has_trailing_return(); |
| 65 | #else |
| 66 | int no_trailing_return(); |
| 67 | #endif |
| 68 | |
| 69 | // CHECK-0X: has_trailing_return |
| 70 | // CHECK-NO-0X: no_trailing_return |
| 71 | |
| 72 | |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 73 | #if __has_feature(cxx_attributes) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 74 | int has_attributes(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 75 | #else |
| 76 | int no_attributes(); |
| 77 | #endif |
| 78 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 79 | // CHECK-0X: has_attributes |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 80 | // CHECK-NO-0X: no_attributes |
| 81 | |
| 82 | |
| 83 | #if __has_feature(cxx_static_assert) |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 84 | int has_static_assert(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 85 | #else |
| 86 | int no_static_assert(); |
| 87 | #endif |
| 88 | |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 89 | // CHECK-0X: has_static_assert |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 90 | // CHECK-NO-0X: no_static_assert |
| 91 | |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 92 | #if __has_feature(cxx_deleted_functions) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 93 | int has_deleted_functions(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 94 | #else |
| 95 | int no_deleted_functions(); |
| 96 | #endif |
| 97 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 98 | // CHECK-0X: has_deleted_functions |
| 99 | // CHECK-NO-0X: no_deleted_functions |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 100 | |
Douglas Gregor | f695a69 | 2011-11-01 01:19:34 +0000 | [diff] [blame] | 101 | #if __has_feature(cxx_defaulted_functions) |
| 102 | int has_defaulted_functions(); |
| 103 | #else |
| 104 | int no_defaulted_functions(); |
| 105 | #endif |
| 106 | |
| 107 | // CHECK-0X: has_defaulted_functions |
| 108 | // CHECK-NO-0X: no_defaulted_functions |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 109 | |
| 110 | #if __has_feature(cxx_rvalue_references) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 111 | int has_rvalue_references(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 112 | #else |
| 113 | int no_rvalue_references(); |
| 114 | #endif |
| 115 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 116 | // CHECK-0X: has_rvalue_references |
| 117 | // CHECK-NO-0X: no_rvalue_references |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 118 | |
| 119 | |
| 120 | #if __has_feature(cxx_variadic_templates) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 121 | int has_variadic_templates(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 122 | #else |
| 123 | int no_variadic_templates(); |
| 124 | #endif |
| 125 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 126 | // CHECK-0X: has_variadic_templates |
| 127 | // CHECK-NO-0X: no_variadic_templates |
Sebastian Redl | f6c0977 | 2010-08-31 23:28:47 +0000 | [diff] [blame] | 128 | |
| 129 | |
| 130 | #if __has_feature(cxx_inline_namespaces) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 131 | int has_inline_namespaces(); |
Sebastian Redl | f6c0977 | 2010-08-31 23:28:47 +0000 | [diff] [blame] | 132 | #else |
| 133 | int no_inline_namespaces(); |
| 134 | #endif |
| 135 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 136 | // CHECK-0X: has_inline_namespaces |
| 137 | // CHECK-NO-0X: no_inline_namespaces |
Douglas Gregor | 56209ff | 2011-01-26 21:25:54 +0000 | [diff] [blame] | 138 | |
Richard Smith | a391a46 | 2011-04-15 15:14:40 +0000 | [diff] [blame] | 139 | |
| 140 | #if __has_feature(cxx_range_for) |
| 141 | int has_range_for(); |
| 142 | #else |
| 143 | int no_range_for(); |
| 144 | #endif |
| 145 | |
| 146 | // CHECK-0X: has_range_for |
| 147 | // CHECK-NO-0X: no_range_for |
| 148 | |
| 149 | |
Douglas Gregor | 56209ff | 2011-01-26 21:25:54 +0000 | [diff] [blame] | 150 | #if __has_feature(cxx_reference_qualified_functions) |
| 151 | int has_reference_qualified_functions(); |
| 152 | #else |
| 153 | int no_reference_qualified_functions(); |
| 154 | #endif |
| 155 | |
| 156 | // CHECK-0X: has_reference_qualified_functions |
| 157 | // CHECK-NO-0X: no_reference_qualified_functions |
| 158 | |
Douglas Gregor | 0750800 | 2011-02-05 20:35:30 +0000 | [diff] [blame] | 159 | #if __has_feature(cxx_default_function_template_args) |
| 160 | int has_default_function_template_args(); |
| 161 | #else |
| 162 | int no_default_function_template_args(); |
| 163 | #endif |
| 164 | |
| 165 | // CHECK-0X: has_default_function_template_args |
| 166 | // CHECK-NO-0X: no_default_function_template_args |
| 167 | |
Sebastian Redl | 4561ecd | 2011-03-15 21:17:12 +0000 | [diff] [blame] | 168 | #if __has_feature(cxx_noexcept) |
| 169 | int has_noexcept(); |
| 170 | #else |
| 171 | int no_noexcept(); |
| 172 | #endif |
| 173 | |
| 174 | // CHECK-0X: has_noexcept |
| 175 | // CHECK-NO-0X: no_noexcept |
| 176 | |
Anders Carlsson | c8b9f79 | 2011-03-25 15:04:23 +0000 | [diff] [blame] | 177 | #if __has_feature(cxx_override_control) |
| 178 | int has_override_control(); |
| 179 | #else |
| 180 | int no_override_control(); |
| 181 | #endif |
| 182 | |
| 183 | // CHECK-0X: has_override_control |
| 184 | // CHECK-NO-0X: no_override_control |
Richard Smith | 3e4c6c4 | 2011-05-05 21:57:07 +0000 | [diff] [blame] | 185 | |
| 186 | #if __has_feature(cxx_alias_templates) |
| 187 | int has_alias_templates(); |
| 188 | #else |
| 189 | int no_alias_templates(); |
| 190 | #endif |
| 191 | |
| 192 | // CHECK-0X: has_alias_templates |
| 193 | // CHECK-NO-0X: no_alias_templates |
Sebastian Redl | 74e611a | 2011-09-04 18:14:28 +0000 | [diff] [blame] | 194 | |
| 195 | #if __has_feature(cxx_implicit_moves) |
| 196 | int has_implicit_moves(); |
| 197 | #else |
| 198 | int no_implicit_moves(); |
| 199 | #endif |
| 200 | |
| 201 | // CHECK-0X: has_implicit_moves |
| 202 | // CHECK-NO-0X: no_implicit_moves |
Peter Collingbourne | fd5f686 | 2011-10-14 23:44:46 +0000 | [diff] [blame] | 203 | |
| 204 | #if __has_feature(cxx_alignas) |
| 205 | int has_alignas(); |
| 206 | #else |
| 207 | int no_alignas(); |
| 208 | #endif |
| 209 | |
| 210 | // CHECK-0X: has_alignas |
| 211 | // CHECK-NO-0X: no_alignas |
Douglas Gregor | 172b221 | 2011-11-01 01:23:44 +0000 | [diff] [blame] | 212 | |
| 213 | #if __has_feature(cxx_raw_string_literals) |
| 214 | int has_raw_string_literals(); |
| 215 | #else |
| 216 | int no_raw_string_literals(); |
| 217 | #endif |
| 218 | |
| 219 | // CHECK-0X: has_raw_string_literals |
| 220 | // CHECK-NO-0X: no_raw_string_literals |
| 221 | |
| 222 | #if __has_feature(cxx_unicode_literals) |
| 223 | int has_unicode_literals(); |
| 224 | #else |
| 225 | int no_unicode_literals(); |
| 226 | #endif |
| 227 | |
| 228 | // CHECK-0X: has_unicode_literals |
| 229 | // CHECK-NO-0X: no_unicode_literals |
Richard Smith | b5216aa | 2012-02-14 22:56:17 +0000 | [diff] [blame] | 230 | |
| 231 | #if __has_feature(cxx_constexpr) |
| 232 | int has_constexpr(); |
| 233 | #else |
| 234 | int no_constexpr(); |
| 235 | #endif |
| 236 | |
| 237 | // CHECK-0X: has_constexpr |
| 238 | // CHECK-NO-0X: no_constexpr |
Sebastian Redl | d1dc3aa | 2012-02-25 20:51:27 +0000 | [diff] [blame] | 239 | |
| 240 | #if __has_feature(cxx_generalized_initializers) |
| 241 | int has_generalized_initializers(); |
| 242 | #else |
| 243 | int no_generalized_initializers(); |
| 244 | #endif |
| 245 | |
| 246 | // CHECK-0X: has_generalized_initializers |
| 247 | // CHECK-NO-0X: no_generalized_initializers |
Richard Smith | ec92bc7 | 2012-03-03 23:51:05 +0000 | [diff] [blame] | 248 | |
| 249 | #if __has_feature(cxx_unrestricted_unions) |
| 250 | int has_unrestricted_unions(); |
| 251 | #else |
| 252 | int no_unrestricted_unions(); |
| 253 | #endif |
| 254 | |
| 255 | // CHECK-0X: has_unrestricted_unions |
| 256 | // CHECK-NO-0X: no_unrestricted_unions |
Richard Smith | 9c1dda7 | 2012-03-09 08:41:27 +0000 | [diff] [blame] | 257 | |
| 258 | #if __has_feature(cxx_user_literals) |
| 259 | int has_user_literals(); |
| 260 | #else |
| 261 | int no_user_literals(); |
| 262 | #endif |
| 263 | |
| 264 | // CHECK-0X: has_user_literals |
| 265 | // CHECK-NO-0X: no_user_literals |
Douglas Gregor | 7b156dd | 2012-04-04 00:48:39 +0000 | [diff] [blame] | 266 | |
| 267 | #if __has_feature(cxx_local_type_template_args) |
| 268 | int has_local_type_template_args(); |
| 269 | #else |
| 270 | int no_local_type_template_args(); |
| 271 | #endif |
| 272 | |
| 273 | // CHECK-0X: has_local_type_template_args |
| 274 | // CHECK-NO-0X: no_local_type_template_args |