[clang] [Clang] prevent assertion failure by avoiding always-dependent lambdas in constraint-related nested scopes (PR #173776)

Oleksandr T. via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 29 04:06:59 PST 2025


================
@@ -282,3 +281,11 @@ static_assert(__is_same_as(int, helper<int>));
 
 
 } // namespace GH138018
+
+namespace GH172814 {
+auto t() {
+  int x = 0;
+  return [](auto w=[&] { x += w(); }); // expected-error {{lambda expression in default argument cannot capture any entity}} \
+                                       // expected-error {{expected body of lambda expression}}
----------------
a-tarasyuk wrote:

Ok, I've removed it

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


More information about the cfe-commits mailing list