summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-05-24 18:35:01 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-05-24 18:35:01 +0000
commit5f0c0aaf5af3876c36572a73621c2a7652d9c42f (patch)
tree2d18b30a619b43fdec555a502272c08a6992272d
parente739e49c0fad88faf72a309fca0c46bdd4fa20f5 (diff)
downloadbcm5719-llvm-5f0c0aaf5af3876c36572a73621c2a7652d9c42f.tar.gz
bcm5719-llvm-5f0c0aaf5af3876c36572a73621c2a7652d9c42f.zip
Address follow-up feedback for r303712
llvm-svn: 303789
-rw-r--r--clang/include/clang/Basic/DiagnosticSemaKinds.td2
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp2
-rw-r--r--clang/lib/Sema/SemaExpr.cpp7
3 files changed, 5 insertions, 6 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 56dd52db4c9..6da5682a834 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/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/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 8c4b8c35845..a7d7d3b2d3a 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/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<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),
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index d2443d2f03e..83387c21322 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/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<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;
}
OpenPOWER on IntegriCloud