diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-25 17:21:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-25 17:21:40 +0000 |
commit | ffb936801529d767699847f0107f6abaa99c0c26 (patch) | |
tree | b174ca1b7c2d3c72548b2b80685d2d89d7465b6e /lib/Sema/SemaExpr.cpp | |
parent | 10ca337b1e3684547bd21021a23a566f30fa83b4 (diff) |
minor reorg: check both attributes before decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85058 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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<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; } |