File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -815,12 +815,18 @@ struct S {
815815struct Q {
816816 const S* get () const [[clang::lifetimebound]];
817817};
818+
819+ std::string_view foo (std::string_view sv [[clang::lifetimebound]]);
820+
818821void test1 () {
819822 std::string_view k1 = S ().sv ; // OK
820823 std::string_view k2 = S ().s ; // expected-warning {{object backing the pointer will}}
821824
822825 std::string_view k3 = Q ().get ()->sv ; // OK
823826 std::string_view k4 = Q ().get ()->s ; // expected-warning {{object backing the pointer will}}
827+
828+ std::string_view lb1 = foo (S ().s ); // expected-warning {{object backing the pointer will}}
829+ std::string_view lb2 = foo (Q ().get ()->s ); // expected-warning {{object backing the pointer will}}
824830}
825831
826832struct Bar {};
You can’t perform that action at this time.
0 commit comments