================
@@ -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}}
----------------
zyn0217 wrote:
Can we test a valid example?
```cpp
auto f() {
int a = 0;
return [](auto w = [&] { return a; }) {};
};
```
https://github.com/llvm/llvm-project/pull/173776
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits