]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Lexer/cxx-features.cpp
Vendor import of clang trunk r238337:
[FreeBSD/FreeBSD.git] / test / Lexer / cxx-features.cpp
1 // RUN: %clang_cc1 -std=c++98 -verify %s
2 // RUN: %clang_cc1 -std=c++11 -verify %s
3 // RUN: %clang_cc1 -std=c++1y -fsized-deallocation -verify %s
4 // RUN: %clang_cc1 -std=c++1y -fsized-deallocation -fconcepts-ts -DCONCEPTS_TS=1 -verify %s
5
6 // expected-no-diagnostics
7
8 #if __cplusplus < 201103L
9 #define check(macro, cxx98, cxx11, cxx1y) cxx98 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx98
10 #elif __cplusplus < 201304L
11 #define check(macro, cxx98, cxx11, cxx1y) cxx11 == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx11
12 #else
13 #define check(macro, cxx98, cxx11, cxx1y) cxx1y == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx1y
14 #endif
15
16 #if check(binary_literals, 0, 0, 201304)
17 #error "wrong value for __cpp_binary_literals"
18 #endif
19
20 #if check(digit_separators, 0, 0, 201309)
21 #error "wrong value for __cpp_digit_separators"
22 #endif
23
24 #if check(init_captures, 0, 0, 201304)
25 #error "wrong value for __cpp_init_captures"
26 #endif
27
28 #if check(generic_lambdas, 0, 0, 201304)
29 #error "wrong value for __cpp_generic_lambdas"
30 #endif
31
32 #if check(sized_deallocation, 0, 0, 201309)
33 #error "wrong value for __cpp_sized_deallocation"
34 #endif
35
36 #if check(constexpr, 0, 200704, 201304)
37 #error "wrong value for __cpp_constexpr"
38 #endif
39
40 #if check(decltype_auto, 0, 0, 201304)
41 #error "wrong value for __cpp_decltype_auto"
42 #endif
43
44 #if check(return_type_deduction, 0, 0, 201304)
45 #error "wrong value for __cpp_return_type_deduction"
46 #endif
47
48 #if check(runtime_arrays, 0, 0, 0)
49 #error "wrong value for __cpp_runtime_arrays"
50 #endif
51
52 #if check(aggregate_nsdmi, 0, 0, 201304)
53 #error "wrong value for __cpp_aggregate_nsdmi"
54 #endif
55
56 #if check(variable_templates, 0, 0, 201304)
57 #error "wrong value for __cpp_variable_templates"
58 #endif
59
60 #if check(unicode_characters, 0, 200704, 200704)
61 #error "wrong value for __cpp_unicode_characters"
62 #endif
63
64 #if check(raw_strings, 0, 200710, 200710)
65 #error "wrong value for __cpp_raw_strings"
66 #endif
67
68 #if check(unicode_literals, 0, 200710, 200710)
69 #error "wrong value for __cpp_unicode_literals"
70 #endif
71
72 #if check(user_defined_literals, 0, 200809, 200809)
73 #error "wrong value for __cpp_user_defined_literals"
74 #endif
75
76 #if check(lambdas, 0, 200907, 200907)
77 #error "wrong value for __cpp_lambdas"
78 #endif
79
80 #if check(range_based_for, 0, 200907, 200907)
81 #error "wrong value for __cpp_range_based_for"
82 #endif
83
84 #if check(static_assert, 0, 200410, 200410)
85 #error "wrong value for __cpp_static_assert"
86 #endif
87
88 #if check(decltype, 0, 200707, 200707)
89 #error "wrong value for __cpp_decltype"
90 #endif
91
92 #if check(attributes, 0, 200809, 200809)
93 #error "wrong value for __cpp_attributes"
94 #endif
95
96 #if check(rvalue_references, 0, 200610, 200610)
97 #error "wrong value for __cpp_rvalue_references"
98 #endif
99
100 #if check(variadic_templates, 0, 200704, 200704)
101 #error "wrong value for __cpp_variadic_templates"
102 #endif
103
104 #if check(initializer_lists, 0, 200806, 200806)
105 #error "wrong value for __cpp_initializer_lists"
106 #endif
107
108 #if check(delegating_constructors, 0, 200604, 200604)
109 #error "wrong value for __cpp_delegating_constructors"
110 #endif
111
112 #if check(nsdmi, 0, 200809, 200809)
113 #error "wrong value for __cpp_nsdmi"
114 #endif
115
116 #if check(inheriting_constructors, 0, 200802, 200802)
117 #error "wrong value for __cpp_inheriting_constructors"
118 #endif
119
120 #if check(ref_qualifiers, 0, 200710, 200710)
121 #error "wrong value for __cpp_ref_qualifiers"
122 #endif
123
124 #if check(alias_templates, 0, 200704, 200704)
125 #error "wrong value for __cpp_alias_templates"
126 #endif
127
128 #if check(experimental_concepts, 0, 0, CONCEPTS_TS)
129 #error "wrong value for __cpp_experimental_concepts"
130 #endif