[LifetimeSafety] False negative with annotated code and inheritance
Open
clang:temporal-safety
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Example: https://godbolt.org/z/ohsnqdd1o
```
#include
#include
#include
struct [[gsl::Owner]] String : public std::string {
using std::string::string;
};
struct [[gsl::Pointer]] StringView : public std::string_view {
void operator=(const String& s) {
static_cast(this)->operator=(s);
}
};
void simple_dangle() {
StringView v;
{
String s = "hello";
v = s;
}
std::cout << v;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.