| 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | // UNSUPPORTED: c++03 |
| 10 | |
| 11 | // template<class E> class initializer_list; |
| 12 | |
| 13 | // initializer_list(); |
| 14 | |
| 15 | #include <initializer_list> |
| 16 | #include <cassert> |
| 17 | |
| 18 | #include "test_macros.h" |
| 19 | |
| 20 | struct A {}; |
| 21 | |
| 22 | int main(int, char**) |
| 23 | { |
| 24 | std::initializer_list<A> il; |
| 25 | assert(il.size() == 0); |
| 26 | |
| 27 | #if TEST_STD_VER > 11 |
| 28 | constexpr std::initializer_list<A> il2; |
| 29 | static_assert(il2.size() == 0, "" ); |
| 30 | #endif // TEST_STD_VER > 11 |
| 31 | |
| 32 | return 0; |
| 33 | } |
| 34 | |