xref: /llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp (revision bd23d4daac388ea51cde88eb0d776f392b149cdc)
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 // REQUIRES: c++11 || c++14
12 
13 // <functional>
14 
15 // See https://llvm.org/bugs/show_bug.cgi?id=20002
16 
17 #include <functional>
18 #include <type_traits>
19 
20 #include "test_macros.h"
21 
22 using Fn = std::function<void()>;
23 struct S : public std::function<void()> { using function::function; };
24 
25 int main() {
26     S s( [](){} );
27     S f1( s );
28     S f2(std::allocator_arg, std::allocator<int>{}, s);
29 }
30