Closed
Description
We have some supports in member field access for references (#81589). It would be good to diagnose on the view types, see https://godbolt.org/z/zbx8hPera
#include <string_view>
#include <string>
struct S2 {
std::string s2;
};
struct Q3 {
const S2* get() const [[clang::lifetimebound]];
};
void test() {
auto& t = Q3().get()->s2; //dangling, clang diagnoses it.
std::string_view v = Q3().get()->s2; // dangling, clang doesn't diagnose it, bad.
}