libcxx

libcxx mirror with random patches
git clone https://git.neptards.moe/neptards/libcxx.git
Log | Files | Refs

default.pass.cpp (757B)


      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 // UNSUPPORTED: c++98, c++03
     11 
     12 // template<class E> class initializer_list;
     13 
     14 // initializer_list();
     15 
     16 #include <initializer_list>
     17 #include <cassert>
     18 
     19 #include "test_macros.h"
     20 
     21 struct A {};
     22 
     23 int main()
     24 {
     25     std::initializer_list<A> il;
     26     assert(il.size() == 0);
     27 
     28 #if TEST_STD_VER > 11
     29     constexpr std::initializer_list<A> il2;
     30     static_assert(il2.size() == 0, "");
     31 #endif  // TEST_STD_VER > 11
     32 }