Open
Description
The following example is not caught
#include <string>
#include <string_view>
#include <iostream>
struct S {
std::string s;
std::string_view f() const [[clang::lifetimebound]] {
return s;
}
};
void test() {
std::string_view thisIsAnIssue;
thisIsAnIssue = S{}.f();
std::cout << thisIsAnIssue << std::endl;
}
https://godbolt.org/z/onnPjPo95
While this one is
void test() {
std::string_view thisIsAnIssue = S{}.f();
std::cout << thisIsAnIssue << std::endl;
}
https://godbolt.org/z/q57nhWYaT
Could they both be caught?