mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +08:00
Fix inheriting constructor test for std::function.
The test I originally checked in only worked with ToT Clang. This patch updates the test so that it works as far back as 3.5. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276093 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <functional>
|
||||
|
||||
// See https://llvm.org/bugs/show_bug.cgi?id=20002
|
||||
@@ -15,9 +17,10 @@
|
||||
#include <type_traits>
|
||||
|
||||
using Fn = std::function<void()>;
|
||||
struct S : Fn { using function::function; };
|
||||
struct S : public std::function<void()> { using function::function; };
|
||||
|
||||
int main() {
|
||||
S f1( Fn{} );
|
||||
S f2(std::allocator_arg, std::allocator<void>{}, Fn{});
|
||||
S s( [](){} );
|
||||
S f1( s );
|
||||
S f2(std::allocator_arg, std::allocator<int>{}, s);
|
||||
}
|
Reference in New Issue
Block a user