2 // { dg-do compile { target c++14 } }
3 #include <initializer_list>
5 constexpr int max(std::initializer_list<int> ints)
7 int ret = *(ints.begin());
8 for (int i = 0; i < ints.size(); ++i) {
9 if (*(ints.begin()+i) > ret) {
10 ret = *(ints.begin()+i);
18 constexpr int z = max({7,6,5,4,3,2,1});
19 constexpr int z2 = max({5,4,3,2,1});
20 static_assert(z == 7, "");
21 static_assert(z2 == 5, "");