On Mar 12, 2012, at 5:52 PM, Richard Smith wrote: > On Mon, Mar 12, 2012 at 5:37 PM, John McCall <[email protected]> wrote: > Modified: cfe/trunk/test/SemaCXX/lambda-expressions.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/lambda-expressions.cpp?rev=152593&r1=152592&r2=152593&view=diff > ============================================================================== > --- cfe/trunk/test/SemaCXX/lambda-expressions.cpp (original) > +++ cfe/trunk/test/SemaCXX/lambda-expressions.cpp Mon Mar 12 19:37:01 2012 > @@ -139,3 +139,12 @@ > unsigned int result = 0; > auto l = [&]() { ++result; }; > } > + > +namespace ModifyingCapture { > + void test() { > + int n = 0; > + [=] { > + n = 1; // expected-error {{variable is not assignable (captured by > copy)}} > > It would be great if this diagnostic mentioned that the lambda is not marked > as 'mutable'.
I'd been vaguely unhappy with this diagnostic anyway, so I took this prompting to improve it in a couple dimensions. r152598. John.
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
