[libc++] Mark bad_any_cast tests as unsupported when the dylib doesn't support bad_any_cast

With the latest compiler fix to availability, some availability failures
that didn't trigger before now trigger.

llvm-svn: 356678
This commit is contained in:
Louis Dionne 2019-03-21 15:37:11 +00:00
parent 408eb44f49
commit f3486db1f7
3 changed files with 3 additions and 12 deletions

View File

@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14
// UNSUPPORTED: dylib-has-no-bad_any_cast
// <any>
@ -21,10 +22,6 @@ struct TestType {};
using std::any;
using std::any_cast;
// On platforms that do not support any_cast, an additional availability error
// is triggered by these tests.
// expected-error@any_cast_request_invalid_value_category.fail.cpp:* 0+ {{call to unavailable function 'any_cast': introduced in macOS 10.14}}
void test_const_lvalue_cast_request_non_const_lvalue()
{
const any a;

View File

@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14
// UNSUPPORTED: dylib-has-no-bad_any_cast
// <any>
@ -20,10 +21,6 @@
struct TestType {};
struct TestType2 {};
// On platforms that do not support any_cast, an additional availability error
// is triggered by these tests.
// expected-error@const_correctness.fail.cpp:* 0+ {{call to unavailable function 'any_cast': introduced in macOS 10.14}}
int main(int, char**)
{
using std::any;

View File

@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11, c++14
// UNSUPPORTED: dylib-has-no-bad_any_cast
// <any>
@ -39,10 +40,6 @@ struct no_move {
no_move(no_move const&) {}
};
// On platforms that do not support any_cast, an additional availability error
// is triggered by these tests.
// expected-error@not_copy_constructible.fail.cpp:* 0+ {{call to unavailable function 'any_cast': introduced in macOS 10.14}}
int main(int, char**) {
any a;
// expected-error-re@any:* {{static_assert failed{{.*}} "ValueType is required to be an lvalue reference or a CopyConstructible type"}}