has_feature_cxx0x.cpp revision fd5f6866a7574f12ecac5cceb7359ff253f83145
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_lambdas) 5int has_lambdas(); 6#else 7int no_lambdas(); 8#endif 9 10// CHECK-0X: no_lambdas 11// CHECK-NO-0X: no_lambdas 12 13 14#if __has_feature(cxx_nullptr) 15int has_nullptr(); 16#else 17int no_nullptr(); 18#endif 19 20// CHECK-0X: has_nullptr 21// CHECK-NO-0X: no_nullptr 22 23 24#if __has_feature(cxx_decltype) 25int has_decltype(); 26#else 27int no_decltype(); 28#endif 29 30// CHECK-0X: has_decltype 31// CHECK-NO-0X: no_decltype 32 33 34#if __has_feature(cxx_auto_type) 35int has_auto_type(); 36#else 37int no_auto_type(); 38#endif 39 40// CHECK-0X: has_auto_type 41// CHECK-NO-0X: no_auto_type 42 43 44#if __has_feature(cxx_trailing_return) 45int has_trailing_return(); 46#else 47int no_trailing_return(); 48#endif 49 50// CHECK-0X: has_trailing_return 51// CHECK-NO-0X: no_trailing_return 52 53 54#if __has_feature(cxx_attributes) 55int has_attributes(); 56#else 57int no_attributes(); 58#endif 59 60// CHECK-0X: has_attributes 61// CHECK-NO-0X: no_attributes 62 63 64#if __has_feature(cxx_static_assert) 65int has_static_assert(); 66#else 67int no_static_assert(); 68#endif 69 70// CHECK-0X: has_static_assert 71// CHECK-NO-0X: no_static_assert 72 73#if __has_feature(cxx_deleted_functions) 74int has_deleted_functions(); 75#else 76int no_deleted_functions(); 77#endif 78 79// CHECK-0X: has_deleted_functions 80// CHECK-NO-0X: no_deleted_functions 81 82 83#if __has_feature(cxx_rvalue_references) 84int has_rvalue_references(); 85#else 86int no_rvalue_references(); 87#endif 88 89// CHECK-0X: has_rvalue_references 90// CHECK-NO-0X: no_rvalue_references 91 92 93#if __has_feature(cxx_variadic_templates) 94int has_variadic_templates(); 95#else 96int no_variadic_templates(); 97#endif 98 99// CHECK-0X: has_variadic_templates 100// CHECK-NO-0X: no_variadic_templates 101 102 103#if __has_feature(cxx_inline_namespaces) 104int has_inline_namespaces(); 105#else 106int no_inline_namespaces(); 107#endif 108 109// CHECK-0X: has_inline_namespaces 110// CHECK-NO-0X: no_inline_namespaces 111 112 113#if __has_feature(cxx_range_for) 114int has_range_for(); 115#else 116int no_range_for(); 117#endif 118 119// CHECK-0X: has_range_for 120// CHECK-NO-0X: no_range_for 121 122 123#if __has_feature(cxx_reference_qualified_functions) 124int has_reference_qualified_functions(); 125#else 126int no_reference_qualified_functions(); 127#endif 128 129// CHECK-0X: has_reference_qualified_functions 130// CHECK-NO-0X: no_reference_qualified_functions 131 132#if __has_feature(cxx_default_function_template_args) 133int has_default_function_template_args(); 134#else 135int 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 141#if __has_feature(cxx_noexcept) 142int has_noexcept(); 143#else 144int no_noexcept(); 145#endif 146 147// CHECK-0X: has_noexcept 148// CHECK-NO-0X: no_noexcept 149 150#if __has_feature(cxx_override_control) 151int has_override_control(); 152#else 153int no_override_control(); 154#endif 155 156// CHECK-0X: has_override_control 157// CHECK-NO-0X: no_override_control 158 159#if __has_feature(cxx_alias_templates) 160int has_alias_templates(); 161#else 162int no_alias_templates(); 163#endif 164 165// CHECK-0X: has_alias_templates 166// CHECK-NO-0X: no_alias_templates 167 168#if __has_feature(cxx_implicit_moves) 169int has_implicit_moves(); 170#else 171int no_implicit_moves(); 172#endif 173 174// CHECK-0X: has_implicit_moves 175// CHECK-NO-0X: no_implicit_moves 176 177#if __has_feature(cxx_alignas) 178int has_alignas(); 179#else 180int no_alignas(); 181#endif 182 183// CHECK-0X: has_alignas 184// CHECK-NO-0X: no_alignas 185