[LifetimeSafety] Support globally capturing constructor like std::thread, std::async
Open
clang:temporal-safety
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
See https://github.com/llvm/llvm-project/pull/203757
```cpp
void test_thread() {
int x = 0;
std::thread t2([x]() { int y = x; });
}
void test_async_function() {
int x = 0;
std::async([&x]() { x = 1; });
}
```
cc: @kashika0112
Contributor guide
Research direction
Start by reading the referenced pull request, https://github.com/llvm/llvm-project/pull/203757, to find the LifetimeSafety implementation and tests involved. Use the std::thread and std::async examples in this issue as the behavior to trace, and consider the work complete when globally capturing constructors are supported for both patterns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100