Author: rjmccall
Date: Mon Mar 12 20:10:51 2012
New Revision: 152598
URL: http://llvm.org/viewvc/llvm-project?rev=152598&view=rev
Log:
Make the error about assigning to lambda-captured variables
clearer, and mention the existence of mutable lambdas.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/test/SemaCXX/lambda-expressions.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=152598&r1=152597&r2=152598&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Mon Mar 12 20:10:51
2012
@@ -4388,7 +4388,7 @@
def err_block_decl_ref_not_modifiable_lvalue : Error<
"variable is not assignable (missing __block type specifier)">;
def err_lambda_decl_ref_not_modifiable_lvalue : Error<
- "variable is not assignable (captured by copy)">;
+ "cannot assign to a variable captured by copy in a non-mutable lambda">;
def err_typecheck_call_not_function : Error<
"called object type %0 is not a function or function pointer">;
def err_call_incomplete_return : Error<
Modified: cfe/trunk/test/SemaCXX/lambda-expressions.cpp
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/lambda-expressions.cpp?rev=152598&r1=152597&r2=152598&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/lambda-expressions.cpp (original)
+++ cfe/trunk/test/SemaCXX/lambda-expressions.cpp Mon Mar 12 20:10:51 2012
@@ -144,7 +144,7 @@
void test() {
int n = 0;
[=] {
- n = 1; // expected-error {{variable is not assignable (captured by
copy)}}
+ n = 1; // expected-error {{cannot assign to a variable captured by copy
in a non-mutable lambda}}
};
}
}
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits