libcxx

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

default_noexcept.pass.cpp (880B)


      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 // <queue>
     13 
     14 // priority_queue()
     15 //        noexcept(is_nothrow_default_constructible<container_type>::value &&
     16 //                 is_nothrow_default_constructible<Compare>::value);
     17 
     18 // This tests a conforming extension
     19 
     20 
     21 #include <queue>
     22 #include <cassert>
     23 
     24 #include "test_macros.h"
     25 #include "MoveOnly.h"
     26 
     27 int main()
     28 {
     29 #if defined(_LIBCPP_VERSION)
     30     {
     31         typedef std::priority_queue<MoveOnly> C;
     32         static_assert(std::is_nothrow_default_constructible<C>::value, "");
     33     }
     34 #endif
     35 }