From f66e4f7dbd66ff3a9fdd33c4f6b21166ed8c5095 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 23 Jul 2018 22:56:45 +0000 Subject: Support lifetime-extension of conditional temporaries. llvm-svn: 337767 --- clang/test/SemaCXX/conditional-expr.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'clang/test/SemaCXX/conditional-expr.cpp') diff --git a/clang/test/SemaCXX/conditional-expr.cpp b/clang/test/SemaCXX/conditional-expr.cpp index ab19ce54b69..8d0555ea506 100644 --- a/clang/test/SemaCXX/conditional-expr.cpp +++ b/clang/test/SemaCXX/conditional-expr.cpp @@ -229,7 +229,7 @@ void test() // be properly tested at runtime, though. const Abstract &abstract1 = true ? static_cast(Derived1()) : Derived2(); // expected-error {{allocating an object of abstract class type 'const Abstract'}} - const Abstract &abstract2 = true ? static_cast(Derived1()) : throw 3; // expected-warning-re {{sorry, lifetime extension {{.*}} not supported}} + const Abstract &abstract2 = true ? static_cast(Derived1()) : throw 3; } namespace PR6595 { @@ -401,15 +401,11 @@ namespace lifetime_extension { struct C : A { C(); ~C(); }; void f(bool b) { - // expected-warning@+1 2{{sorry, lifetime extension of temporary created within conditional expression is not supported}} A &&r = b ? static_cast(B()) : static_cast(C()); } struct D { A &&a; }; void f_indirect(bool b) { -#if __cplusplus >= 201702L - // expected-warning@+2 2{{sorry, lifetime extension of temporary created within conditional expression is not supported}} -#endif D d = b ? D{B()} : D{C()}; } } -- cgit v1.2.3