]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp
Vendor import of libc++ trunk r290819:
[FreeBSD/FreeBSD.git] / test / std / language.support / support.initlist / support.initlist.cons / default.pass.cpp
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // template<class E> class initializer_list;
11
12 // initializer_list();
13
14 #include <initializer_list>
15 #include <cassert>
16
17 #include "test_macros.h"
18
19 struct A {};
20
21 int main()
22 {
23 #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
24     std::initializer_list<A> il;
25     assert(il.size() == 0);
26 #endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
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 }