Address follow-up feedback for r303712

llvm-svn: 303789
This commit is contained in:
Argyrios Kyrtzidis 2017-05-24 18:35:01 +00:00
parent e739e49c0f
commit 5f0c0aaf5a
3 changed files with 5 additions and 6 deletions

View File

@ -2771,7 +2771,7 @@ def warn_attribute_wrong_decl_type : Warning<
"|types and namespaces"
"|Objective-C interfaces"
"|methods and properties"
"|functions, methods and properties"
"|functions, methods, and properties"
"|struct or union"
"|struct, union or class"
"|types"

View File

@ -1038,7 +1038,7 @@ static void handleDiagnoseIfAttr(Sema &S, Decl *D, const AttributeList &Attr) {
}
bool ArgDependent = false;
if (auto *FD = dyn_cast<FunctionDecl>(D))
if (const auto *FD = dyn_cast<FunctionDecl>(D))
ArgDependent = ArgumentDependenceChecker(FD).referencesArgs(Cond);
D->addAttr(::new (S.Context) DiagnoseIfAttr(
Attr.getRange(), S.Context, Cond, Msg, DiagType, ArgDependent, cast<NamedDecl>(D),

View File

@ -370,15 +370,14 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc,
auto getReferencedObjCProp = [](const NamedDecl *D) ->
const ObjCPropertyDecl * {
if (auto *MD = dyn_cast<ObjCMethodDecl>(D))
if (const auto *MD = dyn_cast<ObjCMethodDecl>(D))
return MD->findPropertyDecl();
return nullptr;
};
if (auto *ObjCPDecl = getReferencedObjCProp(D)) {
if (const ObjCPropertyDecl *ObjCPDecl = getReferencedObjCProp(D)) {
if (diagnoseArgIndependentDiagnoseIfAttrs(ObjCPDecl, Loc))
return true;
} else {
if (diagnoseArgIndependentDiagnoseIfAttrs(D, Loc))
} else if (diagnoseArgIndependentDiagnoseIfAttrs(D, Loc)) {
return true;
}