forked from OSchip/llvm-project
parent
e739e49c0f
commit
5f0c0aaf5a
|
@ -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"
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue