diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-10-16 03:45:06 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-10-16 03:45:06 +0000 |
commit | f72aaff994ee995360817244def4db1579f0cd7a (patch) | |
tree | 0a49444ec7c81d8c9f440f24c0d05213dba8a986 /libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp | |
parent | 015fcffd57fb71fa29d307ac54b8626c8088b856 (diff) | |
download | bcm5719-llvm-f72aaff994ee995360817244def4db1579f0cd7a.tar.gz bcm5719-llvm-f72aaff994ee995360817244def4db1579f0cd7a.zip |
Update LWG 2767 and add test case
llvm-svn: 284324
Diffstat (limited to 'libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp')
-rw-r--r-- | libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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(); } |