diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-12-26 00:13:29 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-12-26 00:13:29 +0000 |
commit | dfa5f9b5114970367902e7fcff2b86522b7cb209 (patch) | |
tree | fdff7111beb6d3229b9f9e371b54fbbd0b89c97a /clang/lib/Sema/Sema.cpp | |
parent | b44f8901334c2f3d88898d1eb230d615636d2172 (diff) | |
download | bcm5719-llvm-dfa5f9b5114970367902e7fcff2b86522b7cb209.tar.gz bcm5719-llvm-dfa5f9b5114970367902e7fcff2b86522b7cb209.zip |
Use the most recent redecl to decide if it is needed.
This fixes pr14691, which I think is a regression from r168519.
llvm-svn: 171077
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index e195bbfff33..e444f3c3570 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -328,7 +328,7 @@ CastKind Sema::ScalarTypeToBooleanCastKind(QualType ScalarTy) { /// \brief Used to prune the decls of Sema's UnusedFileScopedDecls vector. static bool ShouldRemoveFromUnused(Sema *SemaRef, const DeclaratorDecl *D) { - if (D->isUsed()) + if (D->getMostRecentDecl()->isUsed()) return true; if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { |