Update LWG 2767 and add test case

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@284324 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-10-16 03:45:06 +00:00
parent 46c0fcb2b3
commit fcdb3f77e8
2 changed files with 16 additions and 2 deletions

View File

@@ -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();
}