1 // RUN: %clang_cc1 -emit-pch -std=c++23 -o %t %s
2 // RUN: %clang_cc1 -include-pch %t -verify -fsyntax-only -DTEST -std=c++23 %s
4 // Test that dependence of 'this' and DREs due to by-value capture by a
5 // lambda with an explicit object parameter is serialised/deserialised
13 return [*this] (this auto&&) {
17 const auto l
= [y
] (this auto&&) { y
= 42; };
24 // expected-error@* {{read-only variable is not assignable}}
25 // expected-error@* {{cannot assign to a variable captured by copy in a non-mutable lambda}}
26 // expected-note@* 2 {{in instantiation of}}
30 const auto l
= S
{}.f();
31 l(); // expected-note {{in instantiation of}}