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