has_feature_cxx0x.cpp revision 7c07e964d72a287aa3d5714731e202c3ffa17007
1// RUN: %clang_cc1 -E -std=c++11 %s -o - | FileCheck --check-prefix=CHECK-0X %s 2// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-0X %s 3 4#if __has_feature(cxx_atomic) 5int has_atomic(); 6#else 7int no_atomic(); 8#endif 9 10// CHECK-0X: has_atomic 11// CHECK-NO-0X: no_atomic 12 13#if __has_feature(cxx_lambdas) 14int has_lambdas(); 15#else 16int no_lambdas(); 17#endif 18 19// CHECK-0X: has_lambdas 20// CHECK-NO-0X: no_lambdas 21 22 23#if __has_feature(cxx_nullptr) 24int has_nullptr(); 25#else 26int no_nullptr(); 27#endif 28 29// CHECK-0X: has_nullptr 30// CHECK-NO-0X: no_nullptr 31 32 33#if __has_feature(cxx_decltype) 34int has_decltype(); 35#else 36int no_decltype(); 37#endif 38 39// CHECK-0X: has_decltype 40// CHECK-NO-0X: no_decltype 41 42 43#if __has_feature(cxx_auto_type) 44int has_auto_type(); 45#else 46int no_auto_type(); 47#endif 48 49// CHECK-0X: has_auto_type 50// CHECK-NO-0X: no_auto_type 51 52 53#if __has_feature(cxx_trailing_return) 54int has_trailing_return(); 55#else 56int no_trailing_return(); 57#endif 58 59// CHECK-0X: has_trailing_return 60// CHECK-NO-0X: no_trailing_return 61 62 63#if __has_feature(cxx_attributes) 64int has_attributes(); 65#else 66int no_attributes(); 67#endif 68 69// CHECK-0X: has_attributes 70// CHECK-NO-0X: no_attributes 71 72 73#if __has_feature(cxx_static_assert) 74int has_static_assert(); 75#else 76int no_static_assert(); 77#endif 78 79// CHECK-0X: has_static_assert 80// CHECK-NO-0X: no_static_assert 81 82#if __has_feature(cxx_deleted_functions) 83int has_deleted_functions(); 84#else 85int no_deleted_functions(); 86#endif 87 88// CHECK-0X: has_deleted_functions 89// CHECK-NO-0X: no_deleted_functions 90 91#if __has_feature(cxx_defaulted_functions) 92int has_defaulted_functions(); 93#else 94int no_defaulted_functions(); 95#endif 96 97// CHECK-0X: has_defaulted_functions 98// CHECK-NO-0X: no_defaulted_functions 99 100#if __has_feature(cxx_rvalue_references) 101int has_rvalue_references(); 102#else 103int no_rvalue_references(); 104#endif 105 106// CHECK-0X: has_rvalue_references 107// CHECK-NO-0X: no_rvalue_references 108 109 110#if __has_feature(cxx_variadic_templates) 111int has_variadic_templates(); 112#else 113int no_variadic_templates(); 114#endif 115 116// CHECK-0X: has_variadic_templates 117// CHECK-NO-0X: no_variadic_templates 118 119 120#if __has_feature(cxx_inline_namespaces) 121int has_inline_namespaces(); 122#else 123int no_inline_namespaces(); 124#endif 125 126// CHECK-0X: has_inline_namespaces 127// CHECK-NO-0X: no_inline_namespaces 128 129 130#if __has_feature(cxx_range_for) 131int has_range_for(); 132#else 133int no_range_for(); 134#endif 135 136// CHECK-0X: has_range_for 137// CHECK-NO-0X: no_range_for 138 139 140#if __has_feature(cxx_reference_qualified_functions) 141int has_reference_qualified_functions(); 142#else 143int no_reference_qualified_functions(); 144#endif 145 146// CHECK-0X: has_reference_qualified_functions 147// CHECK-NO-0X: no_reference_qualified_functions 148 149#if __has_feature(cxx_default_function_template_args) 150int has_default_function_template_args(); 151#else 152int no_default_function_template_args(); 153#endif 154 155// CHECK-0X: has_default_function_template_args 156// CHECK-NO-0X: no_default_function_template_args 157 158#if __has_feature(cxx_noexcept) 159int has_noexcept(); 160#else 161int no_noexcept(); 162#endif 163 164// CHECK-0X: has_noexcept 165// CHECK-NO-0X: no_noexcept 166 167#if __has_feature(cxx_override_control) 168int has_override_control(); 169#else 170int no_override_control(); 171#endif 172 173// CHECK-0X: has_override_control 174// CHECK-NO-0X: no_override_control 175 176#if __has_feature(cxx_alias_templates) 177int has_alias_templates(); 178#else 179int no_alias_templates(); 180#endif 181 182// CHECK-0X: has_alias_templates 183// CHECK-NO-0X: no_alias_templates 184 185#if __has_feature(cxx_implicit_moves) 186int has_implicit_moves(); 187#else 188int no_implicit_moves(); 189#endif 190 191// CHECK-0X: has_implicit_moves 192// CHECK-NO-0X: no_implicit_moves 193 194#if __has_feature(cxx_alignas) 195int has_alignas(); 196#else 197int no_alignas(); 198#endif 199 200// CHECK-0X: has_alignas 201// CHECK-NO-0X: no_alignas 202 203#if __has_feature(cxx_raw_string_literals) 204int has_raw_string_literals(); 205#else 206int no_raw_string_literals(); 207#endif 208 209// CHECK-0X: has_raw_string_literals 210// CHECK-NO-0X: no_raw_string_literals 211 212#if __has_feature(cxx_unicode_literals) 213int has_unicode_literals(); 214#else 215int no_unicode_literals(); 216#endif 217 218// CHECK-0X: has_unicode_literals 219// CHECK-NO-0X: no_unicode_literals 220 221#if __has_feature(cxx_constexpr) 222int has_constexpr(); 223#else 224int no_constexpr(); 225#endif 226 227// CHECK-0X: has_constexpr 228// CHECK-NO-0X: no_constexpr 229