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