GH60642: Fix ICE when checking a lambda defined in a concept definition

As reported in GH60642, we asserted when there was a lambda defined in a
template arguments inside of a concept, which caused us to not properly
set up the list of instantiation args.  This patch ensures that the
'lambda context decl' correctly falls-through the template argument
instantiation, so that it is available when instantiating the lambda,
and thus, when setting up the lambda instantiation args list.

(cherry picked from commit 4bf6cc63aa77a7fea7e410f7d45899abcde2b58a)
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index 6a05ecc..9d4c7b0 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -4569,7 +4569,7 @@
         getSema(),
         Uneval ? Sema::ExpressionEvaluationContext::Unevaluated
                : Sema::ExpressionEvaluationContext::ConstantEvaluated,
-        /*LambdaContextDecl=*/nullptr, /*ExprContext=*/
+        Sema::ReuseLambdaContextDecl, /*ExprContext=*/
         Sema::ExpressionEvaluationContextRecord::EK_TemplateArgument);
 
     Expr *InputExpr = Input.getSourceExpression();
diff --git a/clang/test/SemaTemplate/concepts-lambda.cpp b/clang/test/SemaTemplate/concepts-lambda.cpp
index eace722..8a184cb 100644
--- a/clang/test/SemaTemplate/concepts-lambda.cpp
+++ b/clang/test/SemaTemplate/concepts-lambda.cpp
@@ -1,6 +1,5 @@
 // RUN: %clang_cc1 -std=c++20 -verify %s
 // RUN: %clang_cc1 -std=c++20 -verify %s -triple powerpc64-ibm-aix
-// expected-no-diagnostics
 
 namespace GH57945 {
   template<typename T>
@@ -92,3 +91,28 @@
 static_assert(ConstructibleWithN<Foo>);
 
 }
+
+// GH60642 reported an assert being hit, make sure we don't assert.
+namespace GH60642 {
+template<auto Q> concept C = requires { Q.template operator()<float>(); };
+template<class> concept D = true;
+static_assert(C<[]<D>{}>);  // ok
+template<class> concept E = C<[]<D>{}>;
+static_assert(E<int>);  // previously Asserted.
+
+// ensure we properly diagnose when "D" is false.
+namespace DIsFalse {
+template<auto Q> concept C = requires { Q.template operator()<float>(); };
+template<class> concept D = false;
+static_assert(C<[]<D>{}>);
+// expected-error@-1{{static assertion failed}}
+// expected-note@-2{{does not satisfy 'C'}}
+// expected-note@-5{{because 'Q.template operator()<float>()' would be invalid: no matching member function for call to 'operator()'}}
+template<class> concept E = C<[]<D>{}>;
+static_assert(E<int>);
+// expected-error@-1{{static assertion failed}}
+// expected-note@-2{{because 'int' does not satisfy 'E'}}
+// expected-note@-4{{does not satisfy 'C'}}
+// expected-note@-11{{because 'Q.template operator()<float>()' would be invalid: no matching member function for call to 'operator()'}}
+}
+}