Home | History | Annotate | Download | only in support.initlist.cons
      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 struct A {};
     18 
     19 int main()
     20 {
     21 #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     22     std::initializer_list<A> il;
     23     assert(il.size() == 0);
     24 #endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     25 #if _LIBCPP_STD_VER > 11
     26     constexpr std::initializer_list<A> il2;
     27     static_assert(il2.size() == 0, "");
     28 #endif  // _LIBCPP_STD_VER > 11
     29 }
     30