Skip to content

Commit ccb6294

Browse files
Add a couple of tests for [[clang::lifetimebound]] annotations in libc++
1 parent 56ca8b1 commit ccb6294

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libcxx/test/libcxx/utilities/utility/forward/lifetimebound.verify.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ void func() {
2525
#if TEST_STD_VER >= 23
2626
auto&& v5 = std::forward_like<int&&>(int{}); // expected-warning {{temporary bound to local reference 'v5' will be destroyed at the end of the full-expression}}
2727
#endif
28+
auto &&v6 = std::vector<int>(2)[1]; // expected-warning {{temporary bound to local reference 'v6' will be destroyed at the end of the full-expression}}
29+
auto v7 = std::set<int>().insert(1); // expected-warning {{temporary bound to local reference 'v7' will be destroyed at the end of the full-expression}}
2830
}

0 commit comments

Comments
 (0)