summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2018-07-25 11:16:39 +0000
committerEric Fiselier <eric@efcs.ca>2018-07-25 11:16:39 +0000
commit1f174327d1ef2a954027ed4b021c339c49b4fb54 (patch)
treec1f212fccc5db8a11d1758519017c10843c0dba5 /libcxx/test
parent6f5c6adbcd287391f313231cd5dd13a85f02c3f1 (diff)
downloadbcm5719-llvm-1f174327d1ef2a954027ed4b021c339c49b4fb54.tar.gz
bcm5719-llvm-1f174327d1ef2a954027ed4b021c339c49b4fb54.zip
Fix diagnostic test to tolerate Clang diagnosing it as well.
Tuple has tests that ensure we diagnose non-lifetime extended reference bindings inside tuples constructors. As of yesterday, Clang now does this for us. Adjust the test to tolerate the new diagnostics, while still testing that we emit diagnostics of our own. Maybe after this version of Clang has been adopted by most users we should remove our diagnostics; but for now more error detection is better! llvm-svn: 337905
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp b/libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp
index 3300f7e831a..cc222a70eb9 100644
--- a/libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp
+++ b/libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp
@@ -46,7 +46,12 @@ void F(typename CannotDeduce<std::tuple<Args...>>::type const&) {}
int main() {
#if TEST_HAS_BUILTIN_IDENTIFIER(__reference_binds_to_temporary)
+ // Test that we emit our diagnostic from the library.
// expected-error@tuple:* 8 {{"Attempted construction of reference element binds to a temporary whose lifetime has ended"}}
+
+ // Good news everybody! Clang now diagnoses this for us!
+ // expected-error@tuple:* 0+ {{reference member '__value_' binds to a temporary object whose lifetime would be shorter than the lifetime of the constructed object}}
+
{
F<int, const std::string&>(std::make_tuple(1, "abc")); // expected-note 1 {{requested here}}
}
OpenPOWER on IntegriCloud