mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 01:18:52 +08:00
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:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user