/gcc/testsuite/g++.dg/cpp0x/constexpr-initlist2.C
C | 10 lines | 6 code | 3 blank | 1 comment | 3 complexity | 4f8d1cfbe2853b13de574f37e3c6fe91 MD5 | raw file
Possible License(s): LGPL-2.0, GPL-2.0, LGPL-2.1, AGPL-1.0, GPL-3.0, BSD-3-Clause
- // { dg-options -std=c++0x }
- #include <initializer_list>
- constexpr auto list = { 1, 2, 3, 4 };
- #define SA(X) static_assert(X, #X)
- SA(list.size() == 4);
- SA(list.begin()[2] == 3);
- SA(list.end()[-1] == 4);