-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Closed
Labels
clang:memory-safetyIssue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr)Issue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr)false-positiveWarning fires when it should notWarning fires when it should not
Description
https://godbolt.org/z/YW8eeWG1x
namespace std {
template <typename T>
struct basic_string_view {
const T* data() const;
};
using string_view = basic_string_view<char>;
} // namespace std
template <typename T>
struct StatusOr {
T* operator->() [[clang::lifetimebound]];
};
const char* s() {
StatusOr<std::string_view> s;
return s->data(); // bogus -Wreturn-stack-adddress diagnostic.
}
Metadata
Metadata
Assignees
Labels
clang:memory-safetyIssue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr)Issue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr)false-positiveWarning fires when it should notWarning fires when it should not