has_feature_cxx0x.cpp revision 0750800623dc6d14c4c0c721996ffd4210fcdff3
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// FIXME: We don't implement "auto" well enough to turn on this feature test
41// CHECK-0X: no_auto_type
42// CHECK-NO-0X: no_auto_type
43
44
45#if __has_feature(cxx_attributes)
46int has_attributes();
47#else
48int no_attributes();
49#endif
50
51// CHECK-0X: has_attributes
52// CHECK-NO-0X: no_attributes
53
54
55#if __has_feature(cxx_static_assert)
56int has_static_assert();
57#else
58int no_static_assert();
59#endif
60
61// CHECK-0X: has_static_assert
62// CHECK-NO-0X: no_static_assert
63
64#if __has_feature(cxx_deleted_functions)
65int has_deleted_functions();
66#else
67int no_deleted_functions();
68#endif
69
70// CHECK-0X: has_deleted_functions
71// CHECK-NO-0X: no_deleted_functions
72
73
74#if __has_feature(cxx_rvalue_references)
75int has_rvalue_references();
76#else
77int no_rvalue_references();
78#endif
79
80// CHECK-0X: has_rvalue_references
81// CHECK-NO-0X: no_rvalue_references
82
83
84#if __has_feature(cxx_variadic_templates)
85int has_variadic_templates();
86#else
87int no_variadic_templates();
88#endif
89
90// CHECK-0X: has_variadic_templates
91// CHECK-NO-0X: no_variadic_templates
92
93
94#if __has_feature(cxx_inline_namespaces)
95int has_inline_namespaces();
96#else
97int no_inline_namespaces();
98#endif
99
100// CHECK-0X: has_inline_namespaces
101// CHECK-NO-0X: no_inline_namespaces
102
103#if __has_feature(cxx_reference_qualified_functions)
104int has_reference_qualified_functions();
105#else
106int no_reference_qualified_functions();
107#endif
108
109// CHECK-0X: has_reference_qualified_functions
110// CHECK-NO-0X: no_reference_qualified_functions
111
112#if __has_feature(cxx_default_function_template_args)
113int has_default_function_template_args();
114#else
115int no_default_function_template_args();
116#endif
117
118// CHECK-0X: has_default_function_template_args
119// CHECK-NO-0X: no_default_function_template_args
120
121