From f72aaff994ee995360817244def4db1579f0cd7a Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sun, 16 Oct 2016 03:45:06 +0000 Subject: Update LWG 2767 and add test case llvm-svn: 284324 --- .../utilities/function.objects/func.not_fn/not_fn.pass.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libcxx/test/std/utilities') diff --git a/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp b/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp index 0688b7b06f1..f104385f08b 100644 --- a/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp @@ -580,6 +580,19 @@ void call_operator_noexcept_test() } } +void test_lwg2767() { + // See http://wg21.link/LWG2767 + struct Abstract { virtual void f() const = 0; }; + struct Derived : public Abstract { void f() const {} }; + struct F { bool operator()(Abstract&&) { return false; } }; + { + Derived d; + Abstract &a = d; + bool b = std::not_fn(F{})(std::move(a)); + assert(b); + } +} + int main() { constructor_tests(); @@ -589,4 +602,5 @@ int main() call_operator_sfinae_test(); // somewhat of an extension call_operator_forwarding_test(); call_operator_noexcept_test(); + test_lwg2767(); } -- cgit v1.2.3