has_feature_cxx0x.cpp revision 37bf9d2bb74944c9d9a52522412bc077629977f1
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 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_concepts) 25int concepts(); 26#else 27int no_concepts(); 28#endif 29 30// CHECK-0X: no_concepts 31// CHECK-NO-0X: no_concepts 32 33 34#if __has_feature(cxx_decltype) 35int has_decltype(); 36#else 37int no_decltype(); 38#endif 39 40// CHECK-0X: has_decltype 41// CHECK-NO-0X: no_decltype 42 43 44#if __has_feature(cxx_auto_type) 45int auto_type(); 46#else 47int no_auto_type(); 48#endif 49 50// CHECK-0X: auto_type 51// CHECK-NO-0X: no_auto_type 52 53 54#if __has_feature(cxx_attributes) 55int attributes(); 56#else 57int no_attributes(); 58#endif 59 60// CHECK-0X: 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// We accept this as an extension. 74#if __has_feature(cxx_deleted_functions) 75int deleted_functions(); 76#else 77int no_deleted_functions(); 78#endif 79 80// CHECK-0X: deleted_functions 81// CHECK-NO-0X: deleted_functions 82 83 84#if __has_feature(cxx_rvalue_references) 85int rvalue_references(); 86#else 87int no_rvalue_references(); 88#endif 89 90// CHECK-0X: no_rvalue_references 91// CHECK-NO-0X: no_rvalue_references 92 93 94#if __has_feature(cxx_variadic_templates) 95int variadic_templates(); 96#else 97int no_variadic_templates(); 98#endif 99 100// CHECK-0X: no_variadic_templates 101// CHECK-NO-0X: no_variadic_templates 102 103 104#if __has_feature(cxx_inline_namespaces) 105int inline_namespaces(); 106#else 107int no_inline_namespaces(); 108#endif 109 110// CHECK-0X: inline_namespaces 111// CHECK-NO-0X: inline_namespaces 112