Author: akirtzidis Date: Wed May 24 13:35:01 2017 New Revision: 303789 URL: http://llvm.org/viewvc/llvm-project?rev=303789&view=rev Log: Address follow-up feedback for r303712
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td cfe/trunk/lib/Sema/SemaDeclAttr.cpp cfe/trunk/lib/Sema/SemaExpr.cpp Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=303789&r1=303788&r2=303789&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed May 24 13:35:01 2017 @@ -2771,7 +2771,7 @@ def warn_attribute_wrong_decl_type : War "|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" Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=303789&r1=303788&r2=303789&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original) +++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed May 24 13:35:01 2017 @@ -1038,7 +1038,7 @@ static void handleDiagnoseIfAttr(Sema &S } 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), Modified: cfe/trunk/lib/Sema/SemaExpr.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=303789&r1=303788&r2=303789&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaExpr.cpp (original) +++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed May 24 13:35:01 2017 @@ -370,15 +370,14 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl * 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; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits