mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 10:07:41 +08:00
Suppress unused warnings in std::invoke tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273348 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -325,18 +325,18 @@ struct MemberObj {
|
||||
|
||||
void noexcept_test() {
|
||||
{
|
||||
NoThrowCallable obj;
|
||||
CopyThrows arg;
|
||||
NoThrowCallable obj; ((void)obj); // suppress unused warning
|
||||
CopyThrows arg; ((void)arg); // suppress unused warning
|
||||
static_assert(noexcept(std::invoke(obj)));
|
||||
static_assert(!noexcept(std::invoke(obj, arg)));
|
||||
static_assert(noexcept(std::invoke(obj, std::move(arg))));
|
||||
}
|
||||
{
|
||||
ThrowsCallable obj;
|
||||
ThrowsCallable obj; ((void)obj); // suppress unused warning
|
||||
static_assert(!noexcept(std::invoke(obj)));
|
||||
}
|
||||
{
|
||||
MemberObj obj{42};
|
||||
MemberObj obj{42}; ((void)obj); // suppress unused warning.
|
||||
static_assert(noexcept(std::invoke(&MemberObj::x, obj)));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user