[LifetimeSafety] Diagnose inherited lifetimebound attributes across redeclarations accurately
Open
clang:temporal-safety
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
After #197753, we found a note pointing incorrectly at an inherited attribute. It says "definition here" while pointing at a declaration.
We should either create a new diagnostic specifically for inherited attributes, or rely on the fix that would happen for #198628.
```cpp
struct View {
friend View friend_redecl(MyObj &obj);
};
View friend_redecl(MyObj &obj [[clang::lifetimebound]]); // note currently appears here! " 'lifetimebound' attribute appears here on the definition"
View friend_redecl(MyObj &obj) {
return View{};
}
```
Contributor guide
Assessment
This issue has not been assessed yet.