aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-02-20 22:59:16 +0000
committerSteve Naroff <snaroff@apple.com>2009-02-20 22:59:16 +0000
commitccef371a67756233aa97770e4fccdfa868b3e2d0 (patch)
treecd57a5f6914e35a05f424aceedd3f50b8a22e6f8 /lib/Sema/SemaDecl.cpp
parent685befeb5f6472585bae473a6389e47cab9eac67 (diff)
Fix <rdar://problem/6500554> missing objc error message.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65198 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index c7f37fc286..dfa1e03177 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1470,8 +1470,7 @@ Sema::ActOnVariableDeclarator(Scope* S, Declarator& D, DeclContext* DC,
CheckExtraCXXDefaultArguments(D);
if (R.getTypePtr()->isObjCInterfaceType()) {
- Diag(D.getIdentifierLoc(), diag::err_statically_allocated_object)
- << D.getIdentifier();
+ Diag(D.getIdentifierLoc(), diag::err_statically_allocated_object);
InvalidDecl = true;
}
@@ -2761,6 +2760,13 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) {
<< D.getCXXScopeSpec().getRange();
New->setInvalidDecl();
}
+ // Parameter declarators cannot be interface types. All ObjC objects are
+ // passed by reference.
+ if (parmDeclType->isObjCInterfaceType()) {
+ Diag(D.getIdentifierLoc(), diag::err_object_cannot_be_by_value)
+ << "passed";
+ New->setInvalidDecl();
+ }
// Add the parameter declaration into this scope.
S->AddDecl(New);
@@ -3671,8 +3677,7 @@ void Sema::ActOnFields(Scope* S,
}
/// A field cannot be an Objective-c object
if (FDTy->isObjCInterfaceType()) {
- Diag(FD->getLocation(), diag::err_statically_allocated_object)
- << FD->getDeclName();
+ Diag(FD->getLocation(), diag::err_statically_allocated_object);
FD->setInvalidDecl();
EnclosingDecl->setInvalidDecl();
continue;