Use hasAttr instead of getAttr for conditionals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69021 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 73d2a52..7675d5a 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1807,7 +1807,7 @@
   }
 
   if (NewVD->hasLocalStorage() && T.isObjCGCWeak()
-      && !NewVD->getAttr<BlocksAttr>())
+      && !NewVD->hasAttr<BlocksAttr>())
     Diag(NewVD->getLocation(), diag::warn_attribute_weak_on_local);
 
   bool isIllegalVLA = T->isVariableArrayType() && NewVD->hasGlobalStorage();