15a83710eSEric Fiselier //===----------------------------------------------------------------------===//
25a83710eSEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65a83710eSEric Fiselier //
75a83710eSEric Fiselier //===----------------------------------------------------------------------===//
85a83710eSEric Fiselier 
9*690287b1SArthur O'Dwyer // UNSUPPORTED: c++03
102a837eaeSMarshall Clow 
115a83710eSEric Fiselier // <iterator>
12020b623aSMarshall Clow // template <class C> constexpr auto begin(C& c) -> decltype(c.begin());
13020b623aSMarshall Clow // template <class C> constexpr auto begin(const C& c) -> decltype(c.begin());
14020b623aSMarshall Clow // template <class C> constexpr auto cbegin(const C& c) -> decltype(std::begin(c)); // C++14
15020b623aSMarshall Clow // template <class C> constexpr auto cend(const C& c) -> decltype(std::end(c));     // C++14
16020b623aSMarshall Clow // template <class C> constexpr auto end  (C& c) -> decltype(c.end());
17020b623aSMarshall Clow // template <class C> constexpr auto end  (const C& c) -> decltype(c.end());
18020b623aSMarshall Clow // template <class E> constexpr reverse_iterator<const E*> rbegin(initializer_list<E> il);
19020b623aSMarshall Clow // template <class E> constexpr reverse_iterator<const E*> rend  (initializer_list<E> il);
20020b623aSMarshall Clow //
21020b623aSMarshall Clow // template <class C> auto constexpr rbegin(C& c) -> decltype(c.rbegin());                 // C++14
22020b623aSMarshall Clow // template <class C> auto constexpr rbegin(const C& c) -> decltype(c.rbegin());           // C++14
23020b623aSMarshall Clow // template <class C> auto constexpr rend(C& c) -> decltype(c.rend());                     // C++14
24020b623aSMarshall Clow // template <class C> constexpr auto rend(const C& c) -> decltype(c.rend());               // C++14
25020b623aSMarshall Clow // template <class T, size_t N> reverse_iterator<T*> constexpr rbegin(T (&array)[N]);      // C++14
26020b623aSMarshall Clow // template <class T, size_t N> reverse_iterator<T*> constexpr rend(T (&array)[N]);        // C++14
27020b623aSMarshall Clow // template <class C> constexpr auto crbegin(const C& c) -> decltype(std::rbegin(c));      // C++14
28020b623aSMarshall Clow // template <class C> constexpr auto crend(const C& c) -> decltype(std::rend(c));          // C++14
29020b623aSMarshall Clow //
30020b623aSMarshall Clow //  All of these are constexpr in C++17
315a83710eSEric Fiselier 
32*690287b1SArthur O'Dwyer #include <array>
33*690287b1SArthur O'Dwyer #include <cassert>
34*690287b1SArthur O'Dwyer #include <initializer_list>
35*690287b1SArthur O'Dwyer #include <iterator>
36*690287b1SArthur O'Dwyer #include <list>
37*690287b1SArthur O'Dwyer #include <vector>
38*690287b1SArthur O'Dwyer 
39f2f2a639SEric Fiselier #include "test_macros.h"
40f2f2a639SEric Fiselier 
41*690287b1SArthur O'Dwyer // Throughout this test, we consistently compare against c.begin() instead of c.cbegin()
42*690287b1SArthur O'Dwyer // because some STL types (e.g. initializer_list) don't syntactically support il.cbegin().
43*690287b1SArthur O'Dwyer // Note that std::cbegin(x) effectively calls std::as_const(x).begin(), not x.cbegin();
44*690287b1SArthur O'Dwyer // see the ContainerHijacker test case below.
45*690287b1SArthur O'Dwyer 
test_arrays_and_initializer_lists_forward()46*690287b1SArthur O'Dwyer TEST_CONSTEXPR_CXX14 bool test_arrays_and_initializer_lists_forward()
47*690287b1SArthur O'Dwyer {
48*690287b1SArthur O'Dwyer   {
49*690287b1SArthur O'Dwyer     int a[] = {1, 2, 3};
50*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::begin(a)), int*);
51*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::end(a)), int*);
52*690287b1SArthur O'Dwyer     assert(std::begin(a) == a);
53*690287b1SArthur O'Dwyer     assert(std::end(a) == a + 3);
54*690287b1SArthur O'Dwyer #if TEST_STD_VER > 11
55*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::cbegin(a)), const int*);
56*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::cend(a)), const int*);
57*690287b1SArthur O'Dwyer     assert(std::cbegin(a) == a);
58*690287b1SArthur O'Dwyer     assert(std::cend(a) == a + 3);
59*690287b1SArthur O'Dwyer #endif
60*690287b1SArthur O'Dwyer 
61*690287b1SArthur O'Dwyer     const auto& ca = a;
62*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::begin(ca)), const int*);
63*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::end(ca)), const int*);
64*690287b1SArthur O'Dwyer     assert(std::begin(ca) == a);
65*690287b1SArthur O'Dwyer     assert(std::end(ca) == a + 3);
66*690287b1SArthur O'Dwyer #if TEST_STD_VER > 11
67*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::cbegin(ca)), const int*);
68*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::cend(ca)), const int*);
69*690287b1SArthur O'Dwyer     assert(std::cbegin(ca) == a);
70*690287b1SArthur O'Dwyer     assert(std::cend(ca) == a + 3);
71*690287b1SArthur O'Dwyer #endif
72*690287b1SArthur O'Dwyer   }
73*690287b1SArthur O'Dwyer   {
74*690287b1SArthur O'Dwyer     std::initializer_list<int> il = {1, 2, 3};
75*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::begin(il)), const int*);
76*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::end(il)), const int*);
77*690287b1SArthur O'Dwyer     assert(std::begin(il) == il.begin());
78*690287b1SArthur O'Dwyer     assert(std::end(il) == il.end());
79*690287b1SArthur O'Dwyer #if TEST_STD_VER > 11
80*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::cbegin(il)), const int*);
81*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::cend(il)), const int*);
82*690287b1SArthur O'Dwyer     assert(std::cbegin(il) == il.begin());
83*690287b1SArthur O'Dwyer     assert(std::cend(il) == il.end());
84*690287b1SArthur O'Dwyer #endif
85*690287b1SArthur O'Dwyer 
86*690287b1SArthur O'Dwyer     const auto& cil = il;
87*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::begin(cil)), const int*);
88*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::end(cil)), const int*);
89*690287b1SArthur O'Dwyer     assert(std::begin(cil) == il.begin());
90*690287b1SArthur O'Dwyer     assert(std::end(cil) == il.end());
91*690287b1SArthur O'Dwyer #if TEST_STD_VER > 11
92*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::cbegin(cil)), const int*);
93*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::cend(cil)), const int*);
94*690287b1SArthur O'Dwyer     assert(std::cbegin(cil) == il.begin());
95*690287b1SArthur O'Dwyer     assert(std::cend(cil) == il.end());
96*690287b1SArthur O'Dwyer #endif
97*690287b1SArthur O'Dwyer   }
98*690287b1SArthur O'Dwyer   return true;
99*690287b1SArthur O'Dwyer }
100*690287b1SArthur O'Dwyer 
101*690287b1SArthur O'Dwyer #if TEST_STD_VER > 11
test_arrays_and_initializer_lists_backward()102*690287b1SArthur O'Dwyer TEST_CONSTEXPR_CXX17 bool test_arrays_and_initializer_lists_backward()
103*690287b1SArthur O'Dwyer {
104*690287b1SArthur O'Dwyer   {
105*690287b1SArthur O'Dwyer     int a[] = {1, 2, 3};
106*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::rbegin(a)), std::reverse_iterator<int*>);
107*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::rend(a)), std::reverse_iterator<int*>);
108*690287b1SArthur O'Dwyer     assert(std::rbegin(a).base() == a + 3);
109*690287b1SArthur O'Dwyer     assert(std::rend(a).base() == a);
110*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::crbegin(a)), std::reverse_iterator<const int*>);
111*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::crend(a)), std::reverse_iterator<const int*>);
112*690287b1SArthur O'Dwyer     assert(std::crbegin(a).base() == a + 3);
113*690287b1SArthur O'Dwyer     assert(std::crend(a).base() == a);
114*690287b1SArthur O'Dwyer 
115*690287b1SArthur O'Dwyer     const auto& ca = a;
116*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::rbegin(ca)), std::reverse_iterator<const int*>);
117*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::rend(ca)), std::reverse_iterator<const int*>);
118*690287b1SArthur O'Dwyer     assert(std::rbegin(ca).base() == a + 3);
119*690287b1SArthur O'Dwyer     assert(std::rend(ca).base() == a);
120*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::crbegin(ca)), std::reverse_iterator<const int*>);
121*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::crend(ca)), std::reverse_iterator<const int*>);
122*690287b1SArthur O'Dwyer     assert(std::crbegin(ca).base() == a + 3);
123*690287b1SArthur O'Dwyer     assert(std::crend(ca).base() == a);
124*690287b1SArthur O'Dwyer   }
125*690287b1SArthur O'Dwyer   {
126*690287b1SArthur O'Dwyer     std::initializer_list<int> il = {1, 2, 3};
127*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::rbegin(il)), std::reverse_iterator<const int*>);
128*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::rend(il)), std::reverse_iterator<const int*>);
129*690287b1SArthur O'Dwyer     assert(std::rbegin(il).base() == il.end());
130*690287b1SArthur O'Dwyer     assert(std::rend(il).base() == il.begin());
131*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::crbegin(il)), std::reverse_iterator<const int*>);
132*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::crend(il)), std::reverse_iterator<const int*>);
133*690287b1SArthur O'Dwyer     assert(std::crbegin(il).base() == il.end());
134*690287b1SArthur O'Dwyer     assert(std::crend(il).base() == il.begin());
135*690287b1SArthur O'Dwyer 
136*690287b1SArthur O'Dwyer     const auto& cil = il;
137*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::rbegin(cil)), std::reverse_iterator<const int*>);
138*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::rend(cil)), std::reverse_iterator<const int*>);
139*690287b1SArthur O'Dwyer     assert(std::rbegin(cil).base() == il.end());
140*690287b1SArthur O'Dwyer     assert(std::rend(cil).base() == il.begin());
141*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::crbegin(cil)), std::reverse_iterator<const int*>);
142*690287b1SArthur O'Dwyer     ASSERT_SAME_TYPE(decltype(std::crend(cil)), std::reverse_iterator<const int*>);
143*690287b1SArthur O'Dwyer     assert(std::crbegin(cil).base() == il.end());
144*690287b1SArthur O'Dwyer     assert(std::crend(cil).base() == il.begin());
145*690287b1SArthur O'Dwyer   }
146*690287b1SArthur O'Dwyer   return true;
147*690287b1SArthur O'Dwyer }
148*690287b1SArthur O'Dwyer #endif
1495a83710eSEric Fiselier 
1505a83710eSEric Fiselier template<typename C>
test_container()151*690287b1SArthur O'Dwyer TEST_CONSTEXPR_CXX14 bool test_container() {
152*690287b1SArthur O'Dwyer   C c = {1, 2, 3};
153*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::begin(c)), typename C::iterator);
154*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::end(c)), typename C::iterator);
1555a83710eSEric Fiselier   assert(std::begin(c) == c.begin());
1565a83710eSEric Fiselier   assert(std::end(c) == c.end());
1570f901c7eSStephan T. Lavavej #if TEST_STD_VER > 11
158*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::cbegin(c)), typename C::const_iterator);
159*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::cend(c)), typename C::const_iterator);
160*690287b1SArthur O'Dwyer   assert(std::cbegin(c) == c.begin());
161*690287b1SArthur O'Dwyer   assert(std::cend(c) == c.end());
162*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::rbegin(c)), typename C::reverse_iterator);
163*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::rend(c)), typename C::reverse_iterator);
164*690287b1SArthur O'Dwyer   assert(std::rbegin(c).base() == c.end());
165*690287b1SArthur O'Dwyer   assert(std::rend(c).base() == c.begin());
166*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::crbegin(c)), typename C::const_reverse_iterator);
167*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::crend(c)), typename C::const_reverse_iterator);
168*690287b1SArthur O'Dwyer   assert(std::crbegin(c).base() == c.end());
169*690287b1SArthur O'Dwyer   assert(std::crend(c).base() == c.begin());
1705a83710eSEric Fiselier #endif
171*690287b1SArthur O'Dwyer 
172*690287b1SArthur O'Dwyer   const C& cc = c;
173*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::begin(cc)), typename C::const_iterator);
174*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::end(cc)), typename C::const_iterator);
175*690287b1SArthur O'Dwyer   assert(std::begin(cc) == c.begin());
176*690287b1SArthur O'Dwyer   assert(std::end(cc) == c.end());
177*690287b1SArthur O'Dwyer #if TEST_STD_VER > 11
178*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::cbegin(cc)), typename C::const_iterator);
179*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::cend(cc)), typename C::const_iterator);
180*690287b1SArthur O'Dwyer   assert(std::cbegin(cc) == c.begin());
181*690287b1SArthur O'Dwyer   assert(std::cend(cc) == c.end());
182*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::rbegin(cc)), typename C::const_reverse_iterator);
183*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::rend(cc)), typename C::const_reverse_iterator);
184*690287b1SArthur O'Dwyer   assert(std::rbegin(cc).base() == c.end());
185*690287b1SArthur O'Dwyer   assert(std::rend(cc).base() == c.begin());
186*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::crbegin(cc)), typename C::const_reverse_iterator);
187*690287b1SArthur O'Dwyer   ASSERT_SAME_TYPE(decltype(std::crend(cc)), typename C::const_reverse_iterator);
188*690287b1SArthur O'Dwyer   assert(std::crbegin(cc).base() == c.end());
189*690287b1SArthur O'Dwyer   assert(std::crend(cc).base() == c.begin());
190*690287b1SArthur O'Dwyer #endif
191*690287b1SArthur O'Dwyer 
192*690287b1SArthur O'Dwyer   return true;
1935a83710eSEric Fiselier }
1945a83710eSEric Fiselier 
195*690287b1SArthur O'Dwyer struct ArrayHijacker {
begin(ArrayHijacker (&)[3])196*690287b1SArthur O'Dwyer   friend constexpr int begin(ArrayHijacker(&)[3]) { return 42; }
end(ArrayHijacker (&)[3])197*690287b1SArthur O'Dwyer   friend constexpr int end(ArrayHijacker(&)[3]) { return 42; }
begin(const ArrayHijacker (&)[3])198*690287b1SArthur O'Dwyer   friend constexpr int begin(const ArrayHijacker(&)[3]) { return 42; }
end(const ArrayHijacker (&)[3])199*690287b1SArthur O'Dwyer   friend constexpr int end(const ArrayHijacker(&)[3]) { return 42; }
200*690287b1SArthur O'Dwyer };
201*690287b1SArthur O'Dwyer 
202*690287b1SArthur O'Dwyer struct ContainerHijacker {
203*690287b1SArthur O'Dwyer   int *a_;
beginContainerHijacker204*690287b1SArthur O'Dwyer   constexpr int *begin() const { return a_; }
endContainerHijacker205*690287b1SArthur O'Dwyer   constexpr int *end() const { return a_ + 3; }
rbeginContainerHijacker206*690287b1SArthur O'Dwyer   constexpr int *rbegin() const { return a_; }
rendContainerHijacker207*690287b1SArthur O'Dwyer   constexpr int *rend() const { return a_ + 3; }
begin(ContainerHijacker &)208*690287b1SArthur O'Dwyer   friend constexpr int begin(ContainerHijacker&) { return 42; }
end(ContainerHijacker &)209*690287b1SArthur O'Dwyer   friend constexpr int end(ContainerHijacker&) { return 42; }
begin(const ContainerHijacker &)210*690287b1SArthur O'Dwyer   friend constexpr int begin(const ContainerHijacker&) { return 42; }
end(const ContainerHijacker &)211*690287b1SArthur O'Dwyer   friend constexpr int end(const ContainerHijacker&) { return 42; }
cbegin(ContainerHijacker &)212*690287b1SArthur O'Dwyer   friend constexpr int cbegin(ContainerHijacker&) { return 42; }
cend(ContainerHijacker &)213*690287b1SArthur O'Dwyer   friend constexpr int cend(ContainerHijacker&) { return 42; }
cbegin(const ContainerHijacker &)214*690287b1SArthur O'Dwyer   friend constexpr int cbegin(const ContainerHijacker&) { return 42; }
cend(const ContainerHijacker &)215*690287b1SArthur O'Dwyer   friend constexpr int cend(const ContainerHijacker&) { return 42; }
rbegin(ContainerHijacker &)216*690287b1SArthur O'Dwyer   friend constexpr int rbegin(ContainerHijacker&) { return 42; }
rend(ContainerHijacker &)217*690287b1SArthur O'Dwyer   friend constexpr int rend(ContainerHijacker&) { return 42; }
rbegin(const ContainerHijacker &)218*690287b1SArthur O'Dwyer   friend constexpr int rbegin(const ContainerHijacker&) { return 42; }
rend(const ContainerHijacker &)219*690287b1SArthur O'Dwyer   friend constexpr int rend(const ContainerHijacker&) { return 42; }
crbegin(ContainerHijacker &)220*690287b1SArthur O'Dwyer   friend constexpr int crbegin(ContainerHijacker&) { return 42; }
crend(ContainerHijacker &)221*690287b1SArthur O'Dwyer   friend constexpr int crend(ContainerHijacker&) { return 42; }
crbegin(const ContainerHijacker &)222*690287b1SArthur O'Dwyer   friend constexpr int crbegin(const ContainerHijacker&) { return 42; }
crend(const ContainerHijacker &)223*690287b1SArthur O'Dwyer   friend constexpr int crend(const ContainerHijacker&) { return 42; }
224*690287b1SArthur O'Dwyer };
225*690287b1SArthur O'Dwyer 
test_adl_proofing()226*690287b1SArthur O'Dwyer TEST_CONSTEXPR_CXX17 bool test_adl_proofing() {
227*690287b1SArthur O'Dwyer   // https://llvm.org/PR28927
228*690287b1SArthur O'Dwyer   {
229*690287b1SArthur O'Dwyer     ArrayHijacker a[3] = {};
230*690287b1SArthur O'Dwyer     assert(begin(a) == 42);
231*690287b1SArthur O'Dwyer     assert(end(a) == 42);
232*690287b1SArthur O'Dwyer     assert(std::begin(a) == a);
233*690287b1SArthur O'Dwyer     assert(std::end(a) == a + 3);
2340f901c7eSStephan T. Lavavej #if TEST_STD_VER > 11
235*690287b1SArthur O'Dwyer     assert(std::cbegin(a) == a);
236*690287b1SArthur O'Dwyer     assert(std::cend(a) == a + 3);
237*690287b1SArthur O'Dwyer     assert(std::rbegin(a).base() == a + 3);
238*690287b1SArthur O'Dwyer     assert(std::rend(a).base() == a);
239*690287b1SArthur O'Dwyer     assert(std::crbegin(a).base() == a + 3);
240*690287b1SArthur O'Dwyer     assert(std::crend(a).base() == a);
2415a83710eSEric Fiselier #endif
2425a83710eSEric Fiselier   }
243*690287b1SArthur O'Dwyer   {
244*690287b1SArthur O'Dwyer     int a[3] = {};
245*690287b1SArthur O'Dwyer     ContainerHijacker c{a};
246*690287b1SArthur O'Dwyer     assert(begin(c) == 42);
247*690287b1SArthur O'Dwyer     assert(end(c) == 42);
248*690287b1SArthur O'Dwyer     assert(std::begin(c) == a);
249*690287b1SArthur O'Dwyer     assert(std::end(c) == a + 3);
2500f901c7eSStephan T. Lavavej #if TEST_STD_VER > 11
251*690287b1SArthur O'Dwyer     assert(std::cbegin(c) == a);
252*690287b1SArthur O'Dwyer     assert(std::cend(c) == a + 3);
253*690287b1SArthur O'Dwyer     assert(std::rbegin(c) == a);
254*690287b1SArthur O'Dwyer     assert(std::rend(c) == a + 3);
255*690287b1SArthur O'Dwyer     assert(std::crbegin(c) == a);
256*690287b1SArthur O'Dwyer     assert(std::crend(c) == a + 3);
2575a83710eSEric Fiselier #endif
2585a83710eSEric Fiselier   }
259*690287b1SArthur O'Dwyer   return true;
2605a83710eSEric Fiselier }
2615a83710eSEric Fiselier 
main(int,char **)2622df59c50SJF Bastien int main(int, char**) {
263*690287b1SArthur O'Dwyer   test_arrays_and_initializer_lists_forward();
2640f901c7eSStephan T. Lavavej #if TEST_STD_VER > 11
265*690287b1SArthur O'Dwyer   test_arrays_and_initializer_lists_backward();
2665a83710eSEric Fiselier #endif
267*690287b1SArthur O'Dwyer   test_container<std::array<int, 3>>();
268*690287b1SArthur O'Dwyer   test_container<std::list<int>>();
269*690287b1SArthur O'Dwyer   test_container<std::vector<int>>();
270*690287b1SArthur O'Dwyer   test_adl_proofing();
271020b623aSMarshall Clow 
272*690287b1SArthur O'Dwyer #if TEST_STD_VER > 11
273*690287b1SArthur O'Dwyer   static_assert(test_arrays_and_initializer_lists_forward(), "");
274*690287b1SArthur O'Dwyer #endif
275020b623aSMarshall Clow #if TEST_STD_VER > 14
276*690287b1SArthur O'Dwyer   static_assert(test_arrays_and_initializer_lists_backward());
277*690287b1SArthur O'Dwyer   static_assert(test_container<std::array<int, 3>>());
278*690287b1SArthur O'Dwyer   static_assert(test_adl_proofing());
279020b623aSMarshall Clow #endif
2802df59c50SJF Bastien 
2812df59c50SJF Bastien   return 0;
2825a83710eSEric Fiselier }
283