llvm / llvm/llvm-project

[LifetimeSafety] Diagnose inherited lifetimebound attributes across redeclarations accurately

Open
#198,631 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.