]> granicus.if.org Git - clang/commitdiff
Address follow-up feedback for r303712
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 24 May 2017 18:35:01 +0000 (18:35 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 24 May 2017 18:35:01 +0000 (18:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303789 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaExpr.cpp

index 56dd52db4c9292386cc7d9254452809d85ce1da4..6da5682a834924c7cc2f72d3c96b936b2ba3cf92 100644 (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"
index 8c4b8c358455572930b0f153468dc130bac8be85..a7d7d3b2d3a7c9c447b7b8866a74183135176225 100644 (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),
index d2443d2f03e125b30184f5c143f3abe4bdc7b7b8..83387c213225537a2a8d6d0a1c9964ec2ceb3f8a 100644 (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;
   }