has_feature_cxx0x.cpp revision 738291eedac0f3f3628e34b0b32d6155f280fab2
1// RUN: %clang_cc1 -E -std=c++0x %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: no_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_attributes) 45int has_attributes(); 46#else 47int no_attributes(); 48#endif 49 50// CHECK-0X: has_attributes 51// CHECK-NO-0X: no_attributes 52 53 54#if __has_feature(cxx_static_assert) 55int has_static_assert(); 56#else 57int no_static_assert(); 58#endif 59 60// CHECK-0X: has_static_assert 61// CHECK-NO-0X: no_static_assert 62 63#if __has_feature(cxx_deleted_functions) 64int has_deleted_functions(); 65#else 66int no_deleted_functions(); 67#endif 68 69// CHECK-0X: has_deleted_functions 70// CHECK-NO-0X: no_deleted_functions 71 72 73#if __has_feature(cxx_rvalue_references) 74int has_rvalue_references(); 75#else 76int no_rvalue_references(); 77#endif 78 79// CHECK-0X: has_rvalue_references 80// CHECK-NO-0X: no_rvalue_references 81 82 83#if __has_feature(cxx_variadic_templates) 84int has_variadic_templates(); 85#else 86int no_variadic_templates(); 87#endif 88 89// CHECK-0X: has_variadic_templates 90// CHECK-NO-0X: no_variadic_templates 91 92 93#if __has_feature(cxx_inline_namespaces) 94int has_inline_namespaces(); 95#else 96int no_inline_namespaces(); 97#endif 98 99// CHECK-0X: has_inline_namespaces 100// CHECK-NO-0X: no_inline_namespaces 101 102#if __has_feature(cxx_reference_qualified_functions) 103int has_reference_qualified_functions(); 104#else 105int no_reference_qualified_functions(); 106#endif 107 108// CHECK-0X: has_reference_qualified_functions 109// CHECK-NO-0X: no_reference_qualified_functions 110 111#if __has_feature(cxx_default_function_template_args) 112int has_default_function_template_args(); 113#else 114int no_default_function_template_args(); 115#endif 116 117// CHECK-0X: has_default_function_template_args 118// CHECK-NO-0X: no_default_function_template_args 119 120