diff options
| author | Eric Fiselier <eric@efcs.ca> | 2017-09-17 20:57:05 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2017-09-17 20:57:05 +0000 |
| commit | 6b76a681dd47e1a1f9a5ef9dfc03c62e99a91188 (patch) | |
| tree | 95b5acfa089725ea14c64bbdff12a911a8ce1746 /libcxx/test/std/utilities | |
| parent | 8db966a097b8655779894f1480d4908b1f9bd7cf (diff) | |
| download | bcm5719-llvm-6b76a681dd47e1a1f9a5ef9dfc03c62e99a91188.tar.gz bcm5719-llvm-6b76a681dd47e1a1f9a5ef9dfc03c62e99a91188.zip | |
Fix failing -verify tests due to change in Clangs static_assert message.
Clang recently changed the way it outputs static assert diagnostics.
This patch fixes libc++'s -verify tests so they tolerate both the old
and new message format.
llvm-svn: 313499
Diffstat (limited to 'libcxx/test/std/utilities')
6 files changed, 28 insertions, 28 deletions
diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp index 07578a28e82..9638521260a 100644 --- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp +++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp @@ -25,12 +25,12 @@ using std::any_cast; void test_const_lvalue_cast_request_non_const_lvalue() { const any a; - // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} + // expected-error-re@any:* {{static_assert failed{{.*}} "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} // expected-error@any:* {{binding value of type 'const TestType' to reference to type 'TestType' drops 'const' qualifier}} any_cast<TestType &>(a); // expected-note {{requested here}} const any a2(42); - // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} + // expected-error-re@any:* {{static_assert failed{{.*}} "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} // expected-error@any:* {{binding value of type 'const int' to reference to type 'int' drops 'const' qualifier}} any_cast<int&>(a2); // expected-note {{requested here}} } @@ -38,22 +38,22 @@ void test_const_lvalue_cast_request_non_const_lvalue() void test_lvalue_any_cast_request_rvalue() { any a; - // expected-error@any:* {{static_assert failed "ValueType is required to be an lvalue reference or a CopyConstructible type"}} + // expected-error-re@any:* {{static_assert failed{{.*}} "ValueType is required to be an lvalue reference or a CopyConstructible type"}} any_cast<TestType &&>(a); // expected-note {{requested here}} any a2(42); - // expected-error@any:* {{static_assert failed "ValueType is required to be an lvalue reference or a CopyConstructible type"}} + // expected-error-re@any:* {{static_assert failed{{.*}} "ValueType is required to be an lvalue reference or a CopyConstructible type"}} any_cast<int&&>(a2); // expected-note {{requested here}} } void test_rvalue_any_cast_request_lvalue() { any a; - // expected-error@any:* {{static_assert failed "ValueType is required to be an rvalue reference or a CopyConstructible type"}} + // expected-error-re@any:* {{static_assert failed{{.*}} "ValueType is required to be an rvalue reference or a CopyConstructible type"}} // expected-error@any:* {{non-const lvalue reference to type 'TestType' cannot bind to a temporary}} any_cast<TestType &>(std::move(a)); // expected-note {{requested here}} - // expected-error@any:* {{static_assert failed "ValueType is required to be an rvalue reference or a CopyConstructible type"}} + // expected-error-re@any:* {{static_assert failed{{.*}} "ValueType is required to be an rvalue reference or a CopyConstructible type"}} // expected-error@any:* {{non-const lvalue reference to type 'int' cannot bind to a temporary}} any_cast<int&>(42); } diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.fail.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.fail.cpp index 3f6955a8cbc..0a7712f5ed7 100644 --- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.fail.cpp +++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.fail.cpp @@ -29,18 +29,18 @@ int main() any a; // expected-error@any:* {{binding value of type 'const TestType' to reference to type 'TestType' drops 'const' qualifier}} - // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} + // expected-error-re@any:* {{static_assert failed {{.*}} "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} any_cast<TestType &>(static_cast<any const&>(a)); // expected-note {{requested here}} // expected-error@any:* {{cannot cast from lvalue of type 'const TestType' to rvalue reference type 'TestType &&'; types are not compatible}} - // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} + // expected-error-re@any:* {{static_assert failed {{.*}} "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} any_cast<TestType &&>(static_cast<any const&>(a)); // expected-note {{requested here}} // expected-error@any:* {{binding value of type 'const TestType2' to reference to type 'TestType2' drops 'const' qualifier}} - // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} + // expected-error-re@any:* {{static_assert failed {{.*}} "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} any_cast<TestType2 &>(static_cast<any const&&>(a)); // expected-note {{requested here}} // expected-error@any:* {{cannot cast from lvalue of type 'const TestType2' to rvalue reference type 'TestType2 &&'; types are not compatible}} - // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} + // expected-error-re@any:* {{static_assert failed {{.*}} "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} any_cast<TestType2 &&>(static_cast<any const&&>(a)); // expected-note {{requested here}} } diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp index ed4b96d644d..2d18cf4ba09 100644 --- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp +++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp @@ -42,17 +42,17 @@ struct no_move { int main() { any a; - // expected-error@any:* {{static_assert failed "ValueType is required to be an lvalue reference or a CopyConstructible type"}} + // expected-error-re@any:* {{static_assert failed{{.*}} "ValueType is required to be an lvalue reference or a CopyConstructible type"}} // expected-error@any:* {{static_cast from 'no_copy' to 'no_copy' uses deleted function}} any_cast<no_copy>(static_cast<any&>(a)); // expected-note {{requested here}} - // expected-error@any:* {{static_assert failed "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} + // expected-error-re@any:* {{static_assert failed{{.*}} "ValueType is required to be a const lvalue reference or a CopyConstructible type"}} // expected-error@any:* {{static_cast from 'const no_copy' to 'no_copy' uses deleted function}} any_cast<no_copy>(static_cast<any const&>(a)); // expected-note {{requested here}} any_cast<no_copy>(static_cast<any &&>(a)); // OK - // expected-error@any:* {{static_assert failed "ValueType is required to be an rvalue reference or a CopyConstructible type"}} + // expected-error-re@any:* {{static_assert failed{{.*}} "ValueType is required to be an rvalue reference or a CopyConstructible type"}} // expected-error@any:* {{static_cast from 'typename remove_reference<no_move &>::type' (aka 'no_move') to 'no_move' uses deleted function}} any_cast<no_move>(static_cast<any &&>(a)); } diff --git a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp index bbc135051ef..204c5c0d6af 100644 --- a/libcxx/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp +++ b/libcxx/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp @@ -26,29 +26,29 @@ int main() { any a(1); - // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}} + // expected-error-re@any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} any_cast<int &>(&a); // expected-note {{requested here}} - // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}} + // expected-error-re@any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} any_cast<int &&>(&a); // expected-note {{requested here}} - // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}} + // expected-error-re@any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} any_cast<int const &>(&a); // expected-note {{requested here}} - // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}} + // expected-error-re@any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} any_cast<int const&&>(&a); // expected-note {{requested here}} any const& a2 = a; - // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}} + // expected-error-re@any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} any_cast<int &>(&a2); // expected-note {{requested here}} - // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}} + // expected-error-re@any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} any_cast<int &&>(&a2); // expected-note {{requested here}} - // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}} + // expected-error-re@any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} any_cast<int const &>(&a2); // expected-note {{requested here}} - // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}} + // expected-error-re@any:* 1 {{static_assert failed{{.*}} "_ValueType may not be a reference."}} any_cast<int const &&>(&a2); // expected-note {{requested here}} } diff --git a/libcxx/test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp b/libcxx/test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp index 8a2c77af0ec..11ddcb7c002 100644 --- a/libcxx/test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp +++ b/libcxx/test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp @@ -26,22 +26,22 @@ int main() { using std::optional; { - // expected-error@optional:* 2 {{static_assert failed "instantiation of optional with a reference type is ill-formed}} + // expected-error-re@optional:* 2 {{static_assert failed{{.*}} "instantiation of optional with a reference type is ill-formed}} optional<int&> opt1; optional<int&&> opt2; } { - // expected-error@optional:* {{static_assert failed "instantiation of optional with a non-destructible type is ill-formed"}} + // expected-error-re@optional:* {{static_assert failed{{.*}} "instantiation of optional with a non-destructible type is ill-formed"}} optional<X> opt3; } { - // expected-error@optional:* {{static_assert failed "instantiation of optional with a non-object type is undefined behavior"}} - // expected-error@optional:* {{static_assert failed "instantiation of optional with a non-destructible type is ill-formed}} + // expected-error-re@optional:* {{static_assert failed{{.*}} "instantiation of optional with a non-object type is undefined behavior"}} + // expected-error-re@optional:* {{static_assert failed{{.*}} "instantiation of optional with a non-destructible type is ill-formed}} optional<void()> opt4; } { - // expected-error@optional:* {{static_assert failed "instantiation of optional with a non-object type is undefined behavior"}} - // expected-error@optional:* {{static_assert failed "instantiation of optional with a non-destructible type is ill-formed}} + // expected-error-re@optional:* {{static_assert failed{{.*}} "instantiation of optional with a non-object type is undefined behavior"}} + // expected-error-re@optional:* {{static_assert failed{{.*}} "instantiation of optional with a non-destructible type is ill-formed}} // expected-error@optional:* 1+ {{cannot form a reference to 'void'}} optional<const void> opt4; } diff --git a/libcxx/test/std/utilities/utility/forward/forward.fail.cpp b/libcxx/test/std/utilities/utility/forward/forward.fail.cpp index a3bb890482e..772d58fa6ef 100644 --- a/libcxx/test/std/utilities/utility/forward/forward.fail.cpp +++ b/libcxx/test/std/utilities/utility/forward/forward.fail.cpp @@ -25,7 +25,7 @@ int main() #if TEST_STD_VER >= 11 { std::forward<A&>(source()); // expected-note {{requested here}} - // expected-error@type_traits:* 1 {{static_assert failed "can not forward an rvalue as an lvalue"}} + // expected-error-re@type_traits:* 1 {{static_assert failed {{.*}} "can not forward an rvalue as an lvalue"}} } #else { |

