has_feature_cxx0x.cpp revision 172b221147ab56e60968d3f7ffdb42256622fa4c
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#if __has_feature(cxx_defaulted_functions) 83int has_defaulted_functions(); 84#else 85int no_defaulted_functions(); 86#endif 87 88// CHECK-0X: has_defaulted_functions 89// CHECK-NO-0X: no_defaulted_functions 90 91#if __has_feature(cxx_rvalue_references) 92int has_rvalue_references(); 93#else 94int no_rvalue_references(); 95#endif 96 97// CHECK-0X: has_rvalue_references 98// CHECK-NO-0X: no_rvalue_references 99 100 101#if __has_feature(cxx_variadic_templates) 102int has_variadic_templates(); 103#else 104int no_variadic_templates(); 105#endif 106 107// CHECK-0X: has_variadic_templates 108// CHECK-NO-0X: no_variadic_templates 109 110 111#if __has_feature(cxx_inline_namespaces) 112int has_inline_namespaces(); 113#else 114int no_inline_namespaces(); 115#endif 116 117// CHECK-0X: has_inline_namespaces 118// CHECK-NO-0X: no_inline_namespaces 119 120 121#if __has_feature(cxx_range_for) 122int has_range_for(); 123#else 124int no_range_for(); 125#endif 126 127// CHECK-0X: has_range_for 128// CHECK-NO-0X: no_range_for 129 130 131#if __has_feature(cxx_reference_qualified_functions) 132int has_reference_qualified_functions(); 133#else 134int no_reference_qualified_functions(); 135#endif 136 137// CHECK-0X: has_reference_qualified_functions 138// CHECK-NO-0X: no_reference_qualified_functions 139 140#if __has_feature(cxx_default_function_template_args) 141int has_default_function_template_args(); 142#else 143int 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 149#if __has_feature(cxx_noexcept) 150int has_noexcept(); 151#else 152int no_noexcept(); 153#endif 154 155// CHECK-0X: has_noexcept 156// CHECK-NO-0X: no_noexcept 157 158#if __has_feature(cxx_override_control) 159int has_override_control(); 160#else 161int no_override_control(); 162#endif 163 164// CHECK-0X: has_override_control 165// CHECK-NO-0X: no_override_control 166 167#if __has_feature(cxx_alias_templates) 168int has_alias_templates(); 169#else 170int no_alias_templates(); 171#endif 172 173// CHECK-0X: has_alias_templates 174// CHECK-NO-0X: no_alias_templates 175 176#if __has_feature(cxx_implicit_moves) 177int has_implicit_moves(); 178#else 179int no_implicit_moves(); 180#endif 181 182// CHECK-0X: has_implicit_moves 183// CHECK-NO-0X: no_implicit_moves 184 185#if __has_feature(cxx_alignas) 186int has_alignas(); 187#else 188int no_alignas(); 189#endif 190 191// CHECK-0X: has_alignas 192// CHECK-NO-0X: no_alignas 193 194#if __has_feature(cxx_raw_string_literals) 195int has_raw_string_literals(); 196#else 197int 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) 204int has_unicode_literals(); 205#else 206int no_unicode_literals(); 207#endif 208 209// CHECK-0X: has_unicode_literals 210// CHECK-NO-0X: no_unicode_literals 211