File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -1054,6 +1054,11 @@ Bug Fixes to C++ Support
10541054 Fixes (`#78830 <https://github.com/llvm/llvm-project/issues/78830 >`_)
10551055 Fixes (`#60085 <https://github.com/llvm/llvm-project/issues/60085 >`_)
10561056
1057+
1058+ - Fixed a bug where variables referenced by requires-clauses inside
1059+ nested generic lambdas were not properly injected into the constraint scope.
1060+ (`#73418 <https://github.com/llvm/llvm-project/issues/73418 >`_)
1061+
10571062- Fix incorrect code generation caused by the object argument of ``static operator() `` and ``static operator[] `` calls not being evaluated.
10581063 Fixes (`#67976 <https://github.com/llvm/llvm-project/issues/67976 >`_)
10591064
Original file line number Diff line number Diff line change @@ -612,8 +612,12 @@ bool Sema::SetupConstraintScope(
612612
613613 // If this is a member function, make sure we get the parameters that
614614 // reference the original primary template.
615- if (const auto *FromMemTempl =
616- PrimaryTemplate->getInstantiatedFromMemberTemplate ()) {
615+ // We walk up the instantiated template chain so that nested lambdas get
616+ // handled properly.
617+ for (FunctionTemplateDecl *FromMemTempl =
618+ PrimaryTemplate->getInstantiatedFromMemberTemplate ();
619+ FromMemTempl;
620+ FromMemTempl = FromMemTempl->getInstantiatedFromMemberTemplate ()) {
617621 if (addInstantiatedParametersToScope (FD, FromMemTempl->getTemplatedDecl (),
618622 Scope, MLTAL))
619623 return true ;
Original file line number Diff line number Diff line change @@ -149,3 +149,21 @@ void foo() {
149149 auto caller = make_caller.operator ()<&S1::f1>();
150150}
151151} // namespace ReturnTypeRequirementInLambda
152+
153+ namespace GH73418 {
154+ void foo () {
155+ int x;
156+ [&x](auto ) {
157+ return [](auto y) {
158+ return [](auto obj, auto ... params)
159+ requires requires {
160+ sizeof ...(params);
161+ [](auto ... pack) {
162+ return sizeof ...(pack);
163+ }(params...);
164+ }
165+ { return false ; }(y);
166+ }(x);
167+ }(x);
168+ }
169+ } // namespace GH73418
You can’t perform that action at this time.
0 commit comments