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
6 // expected-no-diagnostics
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
13 #define check(macro, cxx98, cxx11, cxx1y) cxx1y == 0 ? defined(__cpp_##macro) : __cpp_##macro != cxx1y
16 #if check(binary_literals, 0, 0, 201304)
17 #error "wrong value for __cpp_binary_literals"
20 #if check(digit_separators, 0, 0, 201309)
21 #error "wrong value for __cpp_digit_separators"
24 #if check(init_captures, 0, 0, 201304)
25 #error "wrong value for __cpp_init_captures"
28 #if check(generic_lambdas, 0, 0, 201304)
29 #error "wrong value for __cpp_generic_lambdas"
32 #if check(sized_deallocation, 0, 0, 201309)
33 #error "wrong value for __cpp_sized_deallocation"
36 #if check(constexpr, 0, 200704, 201304)
37 #error "wrong value for __cpp_constexpr"
40 #if check(decltype_auto, 0, 0, 201304)
41 #error "wrong value for __cpp_decltype_auto"
44 #if check(return_type_deduction, 0, 0, 201304)
45 #error "wrong value for __cpp_return_type_deduction"
48 #if check(runtime_arrays, 0, 0, 0)
49 #error "wrong value for __cpp_runtime_arrays"
52 #if check(aggregate_nsdmi, 0, 0, 201304)
53 #error "wrong value for __cpp_aggregate_nsdmi"
56 #if check(variable_templates, 0, 0, 201304)
57 #error "wrong value for __cpp_variable_templates"
60 #if check(unicode_characters, 0, 200704, 200704)
61 #error "wrong value for __cpp_unicode_characters"
64 #if check(raw_strings, 0, 200710, 200710)
65 #error "wrong value for __cpp_raw_strings"
68 #if check(unicode_literals, 0, 200710, 200710)
69 #error "wrong value for __cpp_unicode_literals"
72 #if check(user_defined_literals, 0, 200809, 200809)
73 #error "wrong value for __cpp_user_defined_literals"
76 #if check(lambdas, 0, 200907, 200907)
77 #error "wrong value for __cpp_lambdas"
80 #if check(range_based_for, 0, 200907, 200907)
81 #error "wrong value for __cpp_range_based_for"
84 #if check(static_assert, 0, 200410, 200410)
85 #error "wrong value for __cpp_static_assert"
88 #if check(decltype, 0, 200707, 200707)
89 #error "wrong value for __cpp_decltype"
92 #if check(attributes, 0, 200809, 200809)
93 #error "wrong value for __cpp_attributes"
96 #if check(rvalue_references, 0, 200610, 200610)
97 #error "wrong value for __cpp_rvalue_references"
100 #if check(variadic_templates, 0, 200704, 200704)
101 #error "wrong value for __cpp_variadic_templates"
104 #if check(initializer_lists, 0, 200806, 200806)
105 #error "wrong value for __cpp_initializer_lists"
108 #if check(delegating_constructors, 0, 200604, 200604)
109 #error "wrong value for __cpp_delegating_constructors"
112 #if check(nsdmi, 0, 200809, 200809)
113 #error "wrong value for __cpp_nsdmi"
116 #if check(inheriting_constructors, 0, 200802, 200802)
117 #error "wrong value for __cpp_inheriting_constructors"
120 #if check(ref_qualifiers, 0, 200710, 200710)
121 #error "wrong value for __cpp_ref_qualifiers"
124 #if check(alias_templates, 0, 200704, 200704)
125 #error "wrong value for __cpp_alias_templates"
128 #if check(experimental_concepts, 0, 0, CONCEPTS_TS)
129 #error "wrong value for __cpp_experimental_concepts"