[libcxx] r300175 - Cleanup any_cast failure test
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 12 22:27:55 PDT 2017
Author: ericwf
Date: Thu Apr 13 00:27:55 2017
New Revision: 300175
URL: http://llvm.org/viewvc/llvm-project?rev=300175&view=rev
Log:
Cleanup any_cast failure test
Modified:
libcxx/trunk/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp
Modified: libcxx/trunk/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp?rev=300175&r1=300174&r2=300175&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp (original)
+++ libcxx/trunk/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp Thu Apr 13 00:27:55 2017
@@ -25,13 +25,30 @@ using std::any_cast;
int main()
{
any a(1);
- any_cast<int &>(&a); // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
- any_cast<int &&>(&a); // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
- any_cast<int const &>(&a); // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
- any_cast<int const&&>(&a); // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+
+ // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int &>(&a); // expected-note {{requested here}}
+
+ // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int &&>(&a); // expected-note {{requested here}}
+
+ // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int const &>(&a); // expected-note {{requested here}}
+
+ // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int const&&>(&a); // expected-note {{requested here}}
+
any const& a2 = a;
- any_cast<int &>(&a2); // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
- any_cast<int &&>(&a2); // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
- any_cast<int const &>(&a2); // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
- any_cast<int const &&>(&a2); // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+
+ // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int &>(&a2); // expected-note {{requested here}}
+
+ // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int &&>(&a2); // expected-note {{requested here}}
+
+ // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int const &>(&a2); // expected-note {{requested here}}
+
+ // expected-error at any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+ any_cast<int const &&>(&a2); // expected-note {{requested here}}
}
More information about the cfe-commits
mailing list