From 53a420fba21cf1644972b34dcd811a43cdb8368d Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 2 Jan 2017 19:18:58 +0000 Subject: Vendor import of libc++ trunk r290819: https://llvm.org/svn/llvm-project/libcxx/trunk@290819 --- .../func.wrap.func.con/alloc_F.pass.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp') diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp index 352ecfc602be..8d454723320c 100644 --- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp +++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES-ANY: c++98, c++03, c++11, c++14 // class function @@ -16,11 +17,24 @@ #include #include +#include "test_macros.h" #include "min_allocator.h" #include "test_allocator.h" #include "count_new.hpp" #include "../function_types.h" + +#if TEST_STD_VER >= 11 +struct RValueCallable { + template + void operator()(Args&&...) && {} +}; +struct LValueCallable { + template + void operator()(Args&&...) & {} +}; +#endif + class DummyClass {}; template @@ -103,4 +117,14 @@ int main() non_default_test_allocator non_default_alloc(42); test_for_alloc(non_default_alloc); } +#if TEST_STD_VER >= 11 + { + using Fn = std::function; + static_assert(std::is_constructible, LValueCallable&>::value, ""); + static_assert(std::is_constructible, LValueCallable>::value, ""); + static_assert(!std::is_constructible, RValueCallable&>::value, ""); + static_assert(!std::is_constructible, RValueCallable>::value, ""); + } +#endif + } -- cgit v1.3