summaryrefslogtreecommitdiffstats
path: root/test/std/utilities/function.objects
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-07-20 06:46:22 +0000
committerEric Fiselier <eric@efcs.ca>2016-07-20 06:46:22 +0000
commitbda156d540d22cbf67814c328da7d7459b402ec4 (patch)
treedfb2fe9cd2bc0ec3c2dcf2a97bcdd163b8e9b6e2 /test/std/utilities/function.objects
parent62365dc24eb382e54ec036317041a7c34ecb4c64 (diff)
downloadexternal_libcxx-bda156d540d22cbf67814c328da7d7459b402ec4.tar.gz
external_libcxx-bda156d540d22cbf67814c328da7d7459b402ec4.tar.bz2
external_libcxx-bda156d540d22cbf67814c328da7d7459b402ec4.zip
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
Diffstat (limited to 'test/std/utilities/function.objects')
-rw-r--r--test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp
index 3370a2fe9..bc8ab873b 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp
@@ -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{});
-} \ No newline at end of file
+ S s( [](){} );
+ S f1( s );
+ S f2(std::allocator_arg, std::allocator<int>{}, s);
+}