aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-11 19:08:56 +0000
committerChris Lattner <sabre@nondot.org>2009-04-11 19:08:56 +0000
commit2dd979fbd59938babbed76e2376116511b403c93 (patch)
tree8ff66db20db265fdb95647cfa8bd1e0987519f82 /lib/Sema/SemaDecl.cpp
parente294d3fbaffcbc0cf5f16067ab31d2b2763d25e9 (diff)
Improve the 'cannot pass objc interface by value' diagnostic:
1) improve localizability by not passing english strings in. 2) improve location for arguments. 3) print the objc type being passed. Before: method-bad-param.m:15:1: error: Objective-C type cannot be passed by value -(void) my_method:(foo) my_param ^ after: method-bad-param.m:15:25: error: Objective-C interface type 'foo' cannot be passed by value -(void) my_method:(foo) my_param ^ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 474c1e490e..5fe44d3089 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2705,8 +2705,8 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) {
// Parameter declarators cannot be interface types. All ObjC objects are
// passed by reference.
if (T->isObjCInterfaceType()) {
- Diag(D.getIdentifierLoc(), diag::err_object_cannot_be_by_value)
- << "passed";
+ Diag(D.getIdentifierLoc(),
+ diag::err_object_cannot_be_passed_returned_by_value) << 1 << T;
New->setInvalidDecl();
}