[clang] [Clang][test] Re-enable nested generic lambda tests (PR #238805)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 4 06:50:46 PST 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Macro Terra (hongtaihu)

<details>
<summary>Changes</summary>

Re-enable the existing `t2` and `t3` nested generic-lambda tests by removing their `#if 0` guard. Both include a local class member function with a deduced return type; `t3` additionally exercises constraints. All test code and type assertions are unchanged.

Both cases were fixed by eb08c0f1659d12524f58a01bf174177b8acedf2e (#<!-- -->86817), committed on April 2, 2024. Separate native X86 assertions-on bisections identify that commit as the first passing revision for each case; its parent still crashes in `DeduceFunctionTypeFromReturnExpr` with `should have deduced to dependent type`. Moving the dependent return-type adjustment to `CheckFunctionDeclaration` covers the implicitly instantiated `S::f` in these examples, complementing the explicit-specialization declaration tests added by that commit.

Validation: the complete restored file passes its existing C++20 `-fsyntax-only -verify` RUN command twice with assertions enabled at 90fd89ca9155697a1fa4dc2285a4876a8db5ad20. The upstream source at this PR's base matches the tested file before applying this two-line deletion.

Prepared with assistance from Codex.


---
Full diff: https://github.com/llvm/llvm-project/pull/238805.diff


1 Files Affected:

- (modified) clang/test/SemaTemplate/generic-lambda.cpp (-2) 


``````````diff
diff --git a/clang/test/SemaTemplate/generic-lambda.cpp b/clang/test/SemaTemplate/generic-lambda.cpp
index 7e7c3419f1b43c..4986de21bd6624 100644
--- a/clang/test/SemaTemplate/generic-lambda.cpp
+++ b/clang/test/SemaTemplate/generic-lambda.cpp
@@ -27,7 +27,6 @@ template <class T1> X<X<X<T1>>> t1() {
 };
 template X<X<X<int>>> t1<int>();
 
-#if 0 // FIXME: crashes
 template<class T1> auto t2() {
   return []<class T2>(T2) {
     struct S {
@@ -59,7 +58,6 @@ template<class T1> C1<X<X<T1>>> auto t3() {
 };
 template C1<X<X<int>>> auto t3<int>();
 static_assert(is_same<decltype(t3<int>()), X<X<X<int>>>>);
-#endif
 
 namespace GH95735 {
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/238805


More information about the cfe-commits mailing list