Fix warning on qualified typedef with 'unused' attribute, from Jason Haslam!

llvm-svn: 163874
This commit is contained in:
Douglas Gregor 2012-09-14 05:10:40 +00:00
parent 0064c5968f
commit 5c65f62a1e
1 changed files with 1 additions and 1 deletions

View File

@ -1264,7 +1264,7 @@ static bool ShouldDiagnoseUnusedDecl(const NamedDecl *D) {
QualType Ty = VD->getType();
// Only look at the outermost level of typedef.
if (const TypedefType *TT = dyn_cast<TypedefType>(Ty)) {
if (const TypedefType *TT = Ty->getAs<TypedefType>()) {
if (TT->getDecl()->hasAttr<UnusedAttr>())
return false;
}