summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/conditional-expr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-07-23 22:56:45 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-07-23 22:56:45 +0000
commitf66e4f7dbd66ff3a9fdd33c4f6b21166ed8c5095 (patch)
tree98e51c27610797c99b881533987bb7adb9d1dde5 /clang/test/SemaCXX/conditional-expr.cpp
parenta3a462e5ca57789a5bc9f892f27a4d120f03b4c3 (diff)
downloadbcm5719-llvm-f66e4f7dbd66ff3a9fdd33c4f6b21166ed8c5095.tar.gz
bcm5719-llvm-f66e4f7dbd66ff3a9fdd33c4f6b21166ed8c5095.zip
Support lifetime-extension of conditional temporaries.
llvm-svn: 337767
Diffstat (limited to 'clang/test/SemaCXX/conditional-expr.cpp')
-rw-r--r--clang/test/SemaCXX/conditional-expr.cpp6
1 files changed, 1 insertions, 5 deletions
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<const Abstract&>(Derived1()) : Derived2(); // expected-error {{allocating an object of abstract class type 'const Abstract'}}
- const Abstract &abstract2 = true ? static_cast<const Abstract&>(Derived1()) : throw 3; // expected-warning-re {{sorry, lifetime extension {{.*}} not supported}}
+ const Abstract &abstract2 = true ? static_cast<const Abstract&>(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<A&&>(B()) : static_cast<A&&>(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()};
}
}
OpenPOWER on IntegriCloud