xref: /llvm-project/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp (revision 3c62198c616226b7555fe9085bcbb3a05084e4e7)
1d5b53598SEric Fiselier //===----------------------------------------------------------------------===//
2d5b53598SEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6d5b53598SEric Fiselier //
7d5b53598SEric Fiselier //===----------------------------------------------------------------------===//
8d5b53598SEric Fiselier 
931cbe0f2SLouis Dionne // UNSUPPORTED: c++03
10b2e7cc69SEric Fiselier 
11d5b53598SEric Fiselier // <functional>
12d5b53598SEric Fiselier 
13*3c62198cSLouis Dionne // See https://llvm.org/PR20002
14d5b53598SEric Fiselier 
15d5b53598SEric Fiselier #include <functional>
16d5b53598SEric Fiselier #include <type_traits>
17d5b53598SEric Fiselier 
186ecac730SMarshall Clow #include "test_macros.h"
196ecac730SMarshall Clow 
20d5b53598SEric Fiselier using Fn = std::function<void()>;
21b2e7cc69SEric Fiselier struct S : public std::function<void()> { using function::function; };
22d5b53598SEric Fiselier 
main(int,char **)232df59c50SJF Bastien int main(int, char**) {
24b2e7cc69SEric Fiselier     S s( [](){} );
25b2e7cc69SEric Fiselier     S f1( s );
26bc933768SStephan T. Lavavej #if TEST_STD_VER <= 14
27b2e7cc69SEric Fiselier     S f2(std::allocator_arg, std::allocator<int>{}, s);
28bc933768SStephan T. Lavavej #endif
292df59c50SJF Bastien 
302df59c50SJF Bastien   return 0;
31d5b53598SEric Fiselier }
32