summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 1e87a6f8195..95a6faed1ae 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -264,14 +264,13 @@ Sema::FindProtocolDeclaration(bool WarnOnDeclarations,
<< ProtocolId[i].first;
continue;
}
- for (const Attr *attr = PDecl->getAttrs(); attr; attr = attr->getNext()) {
- if (attr->getKind() == Attr::Unavailable)
- Diag(ProtocolId[i].second, diag::warn_unavailable) <<
- PDecl->getDeclName();
- if (attr->getKind() == Attr::Deprecated)
- Diag(ProtocolId[i].second, diag::warn_deprecated) <<
- PDecl->getDeclName();
- }
+
+ if (PDecl->getAttr<UnavailableAttr>())
+ Diag(ProtocolId[i].second, diag::warn_unavailable) <<
+ PDecl->getDeclName();
+ if (PDecl->getAttr<DeprecatedAttr>())
+ Diag(ProtocolId[i].second, diag::warn_deprecated) <<
+ PDecl->getDeclName();
// If this is a forward declaration and we are supposed to warn in this
// case, do it.
OpenPOWER on IntegriCloud