[LifetimeSafety] False-negative in lifetimebound base class constructor
Open
clang:temporal-safety
false-negative
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
```cpp
struct T {};
struct S {
S(const T& t [[clang::lifetimebound]]);
};
struct S2 : S {
S2() : S(T{}) {} // Here S will outlive T{} but it does not trigger.
};
```
https://godbolt.org/z/WsnWzaEn6
Contributor guide
Research direction
Start with the reduced C++ reproducer in the issue and compare its behavior using the linked Compiler Explorer example. Trace the lifetimebound diagnostic handling for a base-class constructor call, then confirm that the shown temporary-lifetime case produces the expected warning without introducing diagnostics for valid code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100