]> granicus.if.org Git - clang/commitdiff
Fix warning on qualified typedef with 'unused' attribute, from Jason Haslam!
authorDouglas Gregor <dgregor@apple.com>
Fri, 14 Sep 2012 05:10:40 +0000 (05:10 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 14 Sep 2012 05:10:40 +0000 (05:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163874 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index 92780d98cdb163da4409c9b36696582519ada0de..7903ed0e30c011ecca44c97697cc7a3c43cfd63d 100644 (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;
     }