llvm / llvm/llvm-project

Type of capture is broken in body of lambda with explicit object parameter

Open
#163,582 5 comments 0 reactions 0 assignees View on GitHub
accepts-invalid clang:frontend confirmed lambda
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

https://godbolt.org/z/W9aW4Gvfo
https://godbolt.org/z/Yd9qanx55

Replacing explicit object parameter with normal parameter list can be correctly rejected.

Contributor guide

Open the contributing guide

Research direction

Start with the two Compiler Explorer reproducers linked in the issue and compare the behavior of lambdas with explicit object parameters against normal parameter lists. Trace the compiler entry point that handles capture analysis for this lambda form. Done means the broken case is correctly rejected, matching the normal-parameter case, with a regression test for both examples.

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
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.