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 | |
| 4 | #if __has_feature(cxx_lambdas) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 5 | int has_lambdas(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 6 | #else |
| 7 | int no_lambdas(); |
| 8 | #endif |
| 9 | |
| 10 | // CHECK-0X: no_lambdas |
| 11 | // CHECK-NO-0X: no_lambdas |
| 12 | |
| 13 | |
| 14 | #if __has_feature(cxx_nullptr) |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 15 | int has_nullptr(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 16 | #else |
| 17 | int no_nullptr(); |
| 18 | #endif |
| 19 | |
Douglas Gregor | 84ee2ee | 2011-05-21 23:15:46 +0000 | [diff] [blame] | 20 | // CHECK-0X: has_nullptr |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 21 | // CHECK-NO-0X: no_nullptr |
| 22 | |
| 23 | |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 24 | #if __has_feature(cxx_decltype) |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 25 | int has_decltype(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 26 | #else |
| 27 | int no_decltype(); |
| 28 | #endif |
| 29 | |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 30 | // CHECK-0X: has_decltype |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 31 | // CHECK-NO-0X: no_decltype |
| 32 | |
| 33 | |
| 34 | #if __has_feature(cxx_auto_type) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 35 | int has_auto_type(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 36 | #else |
| 37 | int no_auto_type(); |
| 38 | #endif |
| 39 | |
Richard Smith | 738291e | 2011-02-20 12:13:05 +0000 | [diff] [blame] | 40 | // CHECK-0X: has_auto_type |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 41 | // CHECK-NO-0X: no_auto_type |
| 42 | |
| 43 | |
Richard Smith | 6a4e73c | 2011-04-03 14:12:46 +0000 | [diff] [blame] | 44 | #if __has_feature(cxx_trailing_return) |
| 45 | int has_trailing_return(); |
| 46 | #else |
| 47 | int no_trailing_return(); |
| 48 | #endif |
| 49 | |
| 50 | // CHECK-0X: has_trailing_return |
| 51 | // CHECK-NO-0X: no_trailing_return |
| 52 | |
| 53 | |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 54 | #if __has_feature(cxx_attributes) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 55 | int has_attributes(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 56 | #else |
| 57 | int no_attributes(); |
| 58 | #endif |
| 59 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 60 | // CHECK-0X: has_attributes |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 61 | // CHECK-NO-0X: no_attributes |
| 62 | |
| 63 | |
| 64 | #if __has_feature(cxx_static_assert) |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 65 | int has_static_assert(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 66 | #else |
| 67 | int no_static_assert(); |
| 68 | #endif |
| 69 | |
Sean Hunt | 1248451 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 70 | // CHECK-0X: has_static_assert |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 71 | // CHECK-NO-0X: no_static_assert |
| 72 | |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 73 | #if __has_feature(cxx_deleted_functions) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 74 | int has_deleted_functions(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 75 | #else |
| 76 | int no_deleted_functions(); |
| 77 | #endif |
| 78 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 79 | // CHECK-0X: has_deleted_functions |
| 80 | // CHECK-NO-0X: no_deleted_functions |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 81 | |
Douglas Gregor | f695a69 | 2011-11-01 01:19:34 +0000 | [diff] [blame] | 82 | #if __has_feature(cxx_defaulted_functions) |
| 83 | int has_defaulted_functions(); |
| 84 | #else |
| 85 | int no_defaulted_functions(); |
| 86 | #endif |
| 87 | |
| 88 | // CHECK-0X: has_defaulted_functions |
| 89 | // CHECK-NO-0X: no_defaulted_functions |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 90 | |
| 91 | #if __has_feature(cxx_rvalue_references) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 92 | int has_rvalue_references(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 93 | #else |
| 94 | int no_rvalue_references(); |
| 95 | #endif |
| 96 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 97 | // CHECK-0X: has_rvalue_references |
| 98 | // CHECK-NO-0X: no_rvalue_references |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 99 | |
| 100 | |
| 101 | #if __has_feature(cxx_variadic_templates) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 102 | int has_variadic_templates(); |
Sean Hunt | 4ef4c6b | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 103 | #else |
| 104 | int no_variadic_templates(); |
| 105 | #endif |
| 106 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 107 | // CHECK-0X: has_variadic_templates |
| 108 | // CHECK-NO-0X: no_variadic_templates |
Sebastian Redl | f6c0977 | 2010-08-31 23:28:47 +0000 | [diff] [blame] | 109 | |
| 110 | |
| 111 | #if __has_feature(cxx_inline_namespaces) |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 112 | int has_inline_namespaces(); |
Sebastian Redl | f6c0977 | 2010-08-31 23:28:47 +0000 | [diff] [blame] | 113 | #else |
| 114 | int no_inline_namespaces(); |
| 115 | #endif |
| 116 | |
Douglas Gregor | c78e259 | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 117 | // CHECK-0X: has_inline_namespaces |
| 118 | // CHECK-NO-0X: no_inline_namespaces |
Douglas Gregor | 56209ff | 2011-01-26 21:25:54 +0000 | [diff] [blame] | 119 | |
Richard Smith | a391a46 | 2011-04-15 15:14:40 +0000 | [diff] [blame] | 120 | |
| 121 | #if __has_feature(cxx_range_for) |
| 122 | int has_range_for(); |
| 123 | #else |
| 124 | int no_range_for(); |
| 125 | #endif |
| 126 | |
| 127 | // CHECK-0X: has_range_for |
| 128 | // CHECK-NO-0X: no_range_for |
| 129 | |
| 130 | |
Douglas Gregor | 56209ff | 2011-01-26 21:25:54 +0000 | [diff] [blame] | 131 | #if __has_feature(cxx_reference_qualified_functions) |
| 132 | int has_reference_qualified_functions(); |
| 133 | #else |
| 134 | int no_reference_qualified_functions(); |
| 135 | #endif |
| 136 | |
| 137 | // CHECK-0X: has_reference_qualified_functions |
| 138 | // CHECK-NO-0X: no_reference_qualified_functions |
| 139 | |
Douglas Gregor | 0750800 | 2011-02-05 20:35:30 +0000 | [diff] [blame] | 140 | #if __has_feature(cxx_default_function_template_args) |
| 141 | int has_default_function_template_args(); |
| 142 | #else |
| 143 | int no_default_function_template_args(); |
| 144 | #endif |
| 145 | |
| 146 | // CHECK-0X: has_default_function_template_args |
| 147 | // CHECK-NO-0X: no_default_function_template_args |
| 148 | |
Sebastian Redl | 4561ecd | 2011-03-15 21:17:12 +0000 | [diff] [blame] | 149 | #if __has_feature(cxx_noexcept) |
| 150 | int has_noexcept(); |
| 151 | #else |
| 152 | int no_noexcept(); |
| 153 | #endif |
| 154 | |
| 155 | // CHECK-0X: has_noexcept |
| 156 | // CHECK-NO-0X: no_noexcept |
| 157 | |
Anders Carlsson | c8b9f79 | 2011-03-25 15:04:23 +0000 | [diff] [blame] | 158 | #if __has_feature(cxx_override_control) |
| 159 | int has_override_control(); |
| 160 | #else |
| 161 | int no_override_control(); |
| 162 | #endif |
| 163 | |
| 164 | // CHECK-0X: has_override_control |
| 165 | // CHECK-NO-0X: no_override_control |
Richard Smith | 3e4c6c4 | 2011-05-05 21:57:07 +0000 | [diff] [blame] | 166 | |
| 167 | #if __has_feature(cxx_alias_templates) |
| 168 | int has_alias_templates(); |
| 169 | #else |
| 170 | int no_alias_templates(); |
| 171 | #endif |
| 172 | |
| 173 | // CHECK-0X: has_alias_templates |
| 174 | // CHECK-NO-0X: no_alias_templates |
Sebastian Redl | 74e611a | 2011-09-04 18:14:28 +0000 | [diff] [blame] | 175 | |
| 176 | #if __has_feature(cxx_implicit_moves) |
| 177 | int has_implicit_moves(); |
| 178 | #else |
| 179 | int no_implicit_moves(); |
| 180 | #endif |
| 181 | |
| 182 | // CHECK-0X: has_implicit_moves |
| 183 | // CHECK-NO-0X: no_implicit_moves |
Peter Collingbourne | fd5f686 | 2011-10-14 23:44:46 +0000 | [diff] [blame] | 184 | |
| 185 | #if __has_feature(cxx_alignas) |
| 186 | int has_alignas(); |
| 187 | #else |
| 188 | int no_alignas(); |
| 189 | #endif |
| 190 | |
| 191 | // CHECK-0X: has_alignas |
| 192 | // CHECK-NO-0X: no_alignas |
Douglas Gregor | 172b221 | 2011-11-01 01:23:44 +0000 | [diff] [blame] | 193 | |
| 194 | #if __has_feature(cxx_raw_string_literals) |
| 195 | int has_raw_string_literals(); |
| 196 | #else |
| 197 | int no_raw_string_literals(); |
| 198 | #endif |
| 199 | |
| 200 | // CHECK-0X: has_raw_string_literals |
| 201 | // CHECK-NO-0X: no_raw_string_literals |
| 202 | |
| 203 | #if __has_feature(cxx_unicode_literals) |
| 204 | int has_unicode_literals(); |
| 205 | #else |
| 206 | int no_unicode_literals(); |
| 207 | #endif |
| 208 | |
| 209 | // CHECK-0X: has_unicode_literals |
| 210 | // CHECK-NO-0X: no_unicode_literals |