llvm / llvm/llvm-project

[LifetimeSafety] Support globally capturing constructor like std::thread, std::async

Open
#203,886 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

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.