forked from OSchip/llvm-project
Implements -Wundeclared-selector for ObjC.
llvm-svn: 73495
This commit is contained in:
parent
2811a257f1
commit
0571d9bbba
|
@ -241,6 +241,9 @@ def error_property_implemented : Error<"property %0 is already implemented">;
|
|||
def warn_objc_property_attr_mutually_exclusive : Warning<
|
||||
"property attributes '%0' and '%1' are mutually exclusive">,
|
||||
InGroup<DiagGroup<"readonly-setter-attrs">>, DefaultIgnore;
|
||||
def warn_undeclared_selector : Warning<
|
||||
"undeclared selector %0">,
|
||||
InGroup<DiagGroup<"undeclared-selector">>, DefaultIgnore;
|
||||
|
||||
// C++ declarations
|
||||
def err_static_assert_expression_is_not_constant : Error<
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue