-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang] Fix the order of addInstantiatedParameters in LambdaScopeForC…
…allOperatorInstantiationRAII (#97215) Currently, `addInstantiatedParameters` is called from the innermost lambda outward. However, when the function parameters of an inner lambda depend on the function parameters of an outer lambda, it can lead to a crash due to the inability to find a mapping for the instantiated decl. This PR corrects this behavior by calling `addInstantiatedParameters` from the outside in. repro code: https://godbolt.org/z/KbsxWesW6 ```cpp namespace dependent_param_concept { template <typename... Ts> void sink(Ts...) {} void dependent_param() { auto L = [](auto... x) { return [](decltype(x)... y) { // `y` depends on `x` return [](int z) requires requires { sink(y..., z); } {}; }; }; L(0, 1)(1, 2)(1); } } // namespace dependent_param_concept ``` This PR is a prerequisite for implmenting #61426
- Loading branch information
Showing
3 changed files
with
43 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters