]> granicus.if.org Git - clang/commitdiff
dyn_cast is more appropriate here.
authorDevang Patel <dpatel@apple.com>
Mon, 4 Oct 2010 22:28:23 +0000 (22:28 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 4 Oct 2010 22:28:23 +0000 (22:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115569 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprScalar.cpp

index c7176cc2ab94bf46a55e536ba59ddbeb10d3aeeb..62433a178141f2ab6fa4411e25806f5213bb79f3 100644 (file)
@@ -730,7 +730,7 @@ Value *ScalarExprEmitter::VisitMemberExpr(MemberExpr *E) {
   if (DI && CGF.CGM.getCodeGenOpts().LimitDebugInfo) {
     QualType PQTy = E->getBase()->IgnoreParenImpCasts()->getType();
     if (const PointerType * PTy = dyn_cast<PointerType>(PQTy))
-      if (FieldDecl *M = cast<FieldDecl>(E->getMemberDecl()))
+      if (FieldDecl *M = dyn_cast<FieldDecl>(E->getMemberDecl()))
         DI->getOrCreateRecordType(PTy->getPointeeType(), 
                                   M->getParent()->getLocation());
   }