diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-03 01:02:44 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-03 01:02:44 +0000 |
commit | c934de67e0c6f2b8000ecdfe66ecac37a5b78006 (patch) | |
tree | 7813566caefa7f6da61feb6e71d75e98b6be1fbf /clang/lib/Sema/SemaExprObjC.cpp | |
parent | c29af947d64ff44e62503a8f51763d9f2bd8dd84 (diff) | |
download | bcm5719-llvm-c934de67e0c6f2b8000ecdfe66ecac37a5b78006.tar.gz bcm5719-llvm-c934de67e0c6f2b8000ecdfe66ecac37a5b78006.zip |
objc: Issue diagnostic when receiver type is a forward class declaration and
it is treated as of 'id' type resulting in multiple method lookup.
// rdar://10686120
llvm-svn: 149653
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index 82e8171d666..7e2180fe0ef 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -1380,11 +1380,15 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, ? PDiag(diag::err_arc_receiver_forward_instance) << (Receiver ? Receiver->getSourceRange() : SourceRange(SuperLoc)) - : PDiag())) { + : PDiag(diag::warn_receiver_forward_instance) + << (Receiver ? Receiver->getSourceRange() + : SourceRange(SuperLoc)))) { if (getLangOptions().ObjCAutoRefCount) return ExprError(); forwardClass = OCIType->getInterfaceDecl(); + Diag(Receiver ? Receiver->getLocStart() + : SuperLoc, diag::note_receiver_is_id); Method = 0; } else { Method = ClassDecl->lookupInstanceMethod(Sel); |