diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-06-16 16:25:00 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-06-16 16:25:00 +0000 |
commit | 7ff22ded2221f442b1f8ff78172938d04ec8c926 (patch) | |
tree | 754b00945a1311d2b88c1475d7dc5ea3f0799c53 /lib | |
parent | 648b981e7a9c2d4bb5c467dc74f8a21410db6a22 (diff) |
Implements -Wundeclared-selector for ObjC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73495 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index b6cf9d8e73..71033b4eed 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -130,6 +130,14 @@ Sema::ExprResult Sema::ParseObjCSelectorExpression(Selector Sel, SourceLocation SelLoc, SourceLocation LParenLoc, SourceLocation RParenLoc) { + ObjCMethodDecl *Method = LookupInstanceMethodInGlobalPool(Sel, + SourceRange(LParenLoc, RParenLoc)); + if (!Method) + Method = LookupFactoryMethodInGlobalPool(Sel, + SourceRange(LParenLoc, RParenLoc)); + if (!Method) + Diag(SelLoc, diag::warn_undeclared_selector) << Sel; + QualType Ty = Context.getObjCSelType(); return new (Context) ObjCSelectorExpr(Ty, Sel, AtLoc, RParenLoc); } |