libcxx

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

derive_from.pass.cpp (769B)


      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 // <functional>
     13 
     14 // See https://bugs.llvm.org/show_bug.cgi?id=20002
     15 
     16 #include <functional>
     17 #include <type_traits>
     18 
     19 #include "test_macros.h"
     20 
     21 using Fn = std::function<void()>;
     22 struct S : public std::function<void()> { using function::function; };
     23 
     24 int main() {
     25     S s( [](){} );
     26     S f1( s );
     27 #if TEST_STD_VER <= 14
     28     S f2(std::allocator_arg, std::allocator<int>{}, s);
     29 #endif
     30 }