Richard Smith | 9ca5c42 | 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 | 8452ef0 | 2010-06-29 16:52:24 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-0X %s |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 3 | |
| 4 | #if __has_feature(cxx_lambdas) |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 5 | int has_lambdas(); |
Alexis Hunt | af4e28d | 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) |
Alexis Hunt | 10e2f72 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 15 | int has_nullptr(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 16 | #else |
| 17 | int no_nullptr(); |
| 18 | #endif |
| 19 | |
Douglas Gregor | 80af313 | 2011-05-21 23:15:46 +0000 | [diff] [blame] | 20 | // CHECK-0X: has_nullptr |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 21 | // CHECK-NO-0X: no_nullptr |
| 22 | |
| 23 | |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 24 | #if __has_feature(cxx_decltype) |
Alexis Hunt | 10e2f72 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 25 | int has_decltype(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 26 | #else |
| 27 | int no_decltype(); |
| 28 | #endif |
| 29 | |
Alexis Hunt | 10e2f72 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 30 | // CHECK-0X: has_decltype |
Alexis Hunt | af4e28d | 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 | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 35 | int has_auto_type(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 36 | #else |
| 37 | int no_auto_type(); |
| 38 | #endif |
| 39 | |
Richard Smith | 7ee0d56 | 2011-02-20 12:13:05 +0000 | [diff] [blame] | 40 | // CHECK-0X: has_auto_type |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 41 | // CHECK-NO-0X: no_auto_type |
| 42 | |
| 43 | |
Richard Smith | 13f68cf | 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 | |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 54 | #if __has_feature(cxx_attributes) |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 55 | int has_attributes(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 56 | #else |
| 57 | int no_attributes(); |
| 58 | #endif |
| 59 | |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 60 | // CHECK-0X: has_attributes |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 61 | // CHECK-NO-0X: no_attributes |
| 62 | |
| 63 | |
| 64 | #if __has_feature(cxx_static_assert) |
Alexis Hunt | 10e2f72 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 65 | int has_static_assert(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 66 | #else |
| 67 | int no_static_assert(); |
| 68 | #endif |
| 69 | |
Alexis Hunt | 10e2f72 | 2010-01-13 08:58:42 +0000 | [diff] [blame] | 70 | // CHECK-0X: has_static_assert |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 71 | // CHECK-NO-0X: no_static_assert |
| 72 | |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 73 | #if __has_feature(cxx_deleted_functions) |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 74 | int has_deleted_functions(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 75 | #else |
| 76 | int no_deleted_functions(); |
| 77 | #endif |
| 78 | |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 79 | // CHECK-0X: has_deleted_functions |
| 80 | // CHECK-NO-0X: no_deleted_functions |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 81 | |
| 82 | |
| 83 | #if __has_feature(cxx_rvalue_references) |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 84 | int has_rvalue_references(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 85 | #else |
| 86 | int no_rvalue_references(); |
| 87 | #endif |
| 88 | |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 89 | // CHECK-0X: has_rvalue_references |
| 90 | // CHECK-NO-0X: no_rvalue_references |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 91 | |
| 92 | |
| 93 | #if __has_feature(cxx_variadic_templates) |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 94 | int has_variadic_templates(); |
Alexis Hunt | af4e28d | 2010-01-13 08:31:49 +0000 | [diff] [blame] | 95 | #else |
| 96 | int no_variadic_templates(); |
| 97 | #endif |
| 98 | |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 99 | // CHECK-0X: has_variadic_templates |
| 100 | // CHECK-NO-0X: no_variadic_templates |
Sebastian Redl | a93bb5b | 2010-08-31 23:28:47 +0000 | [diff] [blame] | 101 | |
| 102 | |
| 103 | #if __has_feature(cxx_inline_namespaces) |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 104 | int has_inline_namespaces(); |
Sebastian Redl | a93bb5b | 2010-08-31 23:28:47 +0000 | [diff] [blame] | 105 | #else |
| 106 | int no_inline_namespaces(); |
| 107 | #endif |
| 108 | |
Douglas Gregor | c41d94e | 2011-01-26 15:36:03 +0000 | [diff] [blame] | 109 | // CHECK-0X: has_inline_namespaces |
| 110 | // CHECK-NO-0X: no_inline_namespaces |
Douglas Gregor | 56d5f0a | 2011-01-26 21:25:54 +0000 | [diff] [blame] | 111 | |
Richard Smith | 9bc6eed | 2011-04-15 15:14:40 +0000 | [diff] [blame] | 112 | |
| 113 | #if __has_feature(cxx_range_for) |
| 114 | int has_range_for(); |
| 115 | #else |
| 116 | int no_range_for(); |
| 117 | #endif |
| 118 | |
| 119 | // CHECK-0X: has_range_for |
| 120 | // CHECK-NO-0X: no_range_for |
| 121 | |
| 122 | |
Douglas Gregor | 56d5f0a | 2011-01-26 21:25:54 +0000 | [diff] [blame] | 123 | #if __has_feature(cxx_reference_qualified_functions) |
| 124 | int has_reference_qualified_functions(); |
| 125 | #else |
| 126 | int no_reference_qualified_functions(); |
| 127 | #endif |
| 128 | |
| 129 | // CHECK-0X: has_reference_qualified_functions |
| 130 | // CHECK-NO-0X: no_reference_qualified_functions |
| 131 | |
Douglas Gregor | 7115aee | 2011-02-05 20:35:30 +0000 | [diff] [blame] | 132 | #if __has_feature(cxx_default_function_template_args) |
| 133 | int has_default_function_template_args(); |
| 134 | #else |
| 135 | int no_default_function_template_args(); |
| 136 | #endif |
| 137 | |
| 138 | // CHECK-0X: has_default_function_template_args |
| 139 | // CHECK-NO-0X: no_default_function_template_args |
| 140 | |
Sebastian Redl | c17003c | 2011-03-15 21:17:12 +0000 | [diff] [blame] | 141 | #if __has_feature(cxx_noexcept) |
| 142 | int has_noexcept(); |
| 143 | #else |
| 144 | int no_noexcept(); |
| 145 | #endif |
| 146 | |
| 147 | // CHECK-0X: has_noexcept |
| 148 | // CHECK-NO-0X: no_noexcept |
| 149 | |
Anders Carlsson | 69f1f93 | 2011-03-25 15:04:23 +0000 | [diff] [blame] | 150 | #if __has_feature(cxx_override_control) |
| 151 | int has_override_control(); |
| 152 | #else |
| 153 | int no_override_control(); |
| 154 | #endif |
| 155 | |
| 156 | // CHECK-0X: has_override_control |
| 157 | // CHECK-NO-0X: no_override_control |
Richard Smith | 3f1b5d0 | 2011-05-05 21:57:07 +0000 | [diff] [blame] | 158 | |
| 159 | #if __has_feature(cxx_alias_templates) |
| 160 | int has_alias_templates(); |
| 161 | #else |
| 162 | int no_alias_templates(); |
| 163 | #endif |
| 164 | |
| 165 | // CHECK-0X: has_alias_templates |
| 166 | // CHECK-NO-0X: no_alias_templates |
Sebastian Redl | e9c4e84 | 2011-09-04 18:14:28 +0000 | [diff] [blame] | 167 | |
| 168 | #if __has_feature(cxx_implicit_moves) |
| 169 | int has_implicit_moves(); |
| 170 | #else |
| 171 | int no_implicit_moves(); |
| 172 | #endif |
| 173 | |
| 174 | // CHECK-0X: has_implicit_moves |
| 175 | // CHECK-NO-0X: no_implicit_moves |
Peter Collingbourne | 60188eb | 2011-10-14 23:44:46 +0000 | [diff] [blame^] | 176 | |
| 177 | #if __has_feature(cxx_alignas) |
| 178 | int has_alignas(); |
| 179 | #else |
| 180 | int no_alignas(); |
| 181 | #endif |
| 182 | |
| 183 | // CHECK-0X: has_alignas |
| 184 | // CHECK-NO-0X: no_alignas |