]> granicus.if.org Git - clang/commitdiff
minor reorg: check both attributes before decl.
authorChris Lattner <sabre@nondot.org>
Sun, 25 Oct 2009 17:21:40 +0000 (17:21 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 25 Oct 2009 17:21:40 +0000 (17:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85058 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index 17956e65ae583c1548e90e1c55d0116d84d396d1..f263e73970e595e71f6dfacfa5bb10644a44ac1f 100644 (file)
@@ -71,6 +71,12 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc) {
       Diag(Loc, diag::warn_deprecated) << D->getDeclName();
   }
 
+  // See if the decl is unavailable
+  if (D->getAttr<UnavailableAttr>()) {
+    Diag(Loc, diag::warn_unavailable) << D->getDeclName();
+    Diag(D->getLocation(), diag::note_unavailable_here) << 0;
+  }
+  
   // See if this is a deleted function.
   if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
     if (FD->isDeleted()) {
@@ -80,12 +86,6 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc) {
     }
   }
 
-  // See if the decl is unavailable
-  if (D->getAttr<UnavailableAttr>()) {
-    Diag(Loc, diag::warn_unavailable) << D->getDeclName();
-    Diag(D->getLocation(), diag::note_unavailable_here) << 0;
-  }
-
   return false;
 }