From: Argyrios Kyrtzidis Date: Wed, 24 May 2017 18:35:01 +0000 (+0000) Subject: Address follow-up feedback for r303712 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3143081d4afe3c116a7f968e1b26c63b4d9c1938;p=clang Address follow-up feedback for r303712 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303789 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 56dd52db4c..6da5682a83 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -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" diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 8c4b8c3584..a7d7d3b2d3 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -1038,7 +1038,7 @@ static void handleDiagnoseIfAttr(Sema &S, Decl *D, const AttributeList &Attr) { } bool ArgDependent = false; - if (auto *FD = dyn_cast(D)) + if (const auto *FD = dyn_cast(D)) ArgDependent = ArgumentDependenceChecker(FD).referencesArgs(Cond); D->addAttr(::new (S.Context) DiagnoseIfAttr( Attr.getRange(), S.Context, Cond, Msg, DiagType, ArgDependent, cast(D), diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index d2443d2f03..83387c2132 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -370,15 +370,14 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc, auto getReferencedObjCProp = [](const NamedDecl *D) -> const ObjCPropertyDecl * { - if (auto *MD = dyn_cast(D)) + if (const auto *MD = dyn_cast(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; }