From: Chris Lattner Date: Sun, 25 Oct 2009 17:21:40 +0000 (+0000) Subject: minor reorg: check both attributes before decl. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ffb936801529d767699847f0107f6abaa99c0c26;p=clang minor reorg: check both attributes before decl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85058 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 17956e65ae..f263e73970 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -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()) { + 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(D)) { if (FD->isDeleted()) { @@ -80,12 +86,6 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc) { } } - // See if the decl is unavailable - if (D->getAttr()) { - Diag(Loc, diag::warn_unavailable) << D->getDeclName(); - Diag(D->getLocation(), diag::note_unavailable_here) << 0; - } - return false; }