diff options
author | Anders Carlsson <andersca@mac.com> | 2009-05-30 17:26:39 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-05-30 17:26:39 +0000 |
commit | f89bb0fa8b2b806b0a3ad23619c1f5acb4aa952a (patch) | |
tree | c7f3fee061325e74e76e123a364453102c789fe2 /lib/Sema/SemaInherit.cpp | |
parent | 7462b39a9bccaf4392687831036713f09f9c0681 (diff) |
Replace a cast with a dyn_cast as suggested by Doug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInherit.cpp')
-rw-r--r-- | lib/Sema/SemaInherit.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Sema/SemaInherit.cpp b/lib/Sema/SemaInherit.cpp index 1eccc1f193..1b968f0fbc 100644 --- a/lib/Sema/SemaInherit.cpp +++ b/lib/Sema/SemaInherit.cpp @@ -195,13 +195,14 @@ bool Sema::LookupInBases(CXXRecordDecl *Class, Paths.ScratchPath.Decls = BaseRecord->lookup(Context, Criteria.Method->getDeclName()); while (Paths.ScratchPath.Decls.first != Paths.ScratchPath.Decls.second) { - CXXMethodDecl *MD = - cast<CXXMethodDecl>(*Paths.ScratchPath.Decls.first); - - OverloadedFunctionDecl::function_iterator MatchedDecl; - if (MD->isVirtual() && !IsOverload(Criteria.Method, MD, MatchedDecl)) { - FoundPathToThisBase = true; - break; + if (CXXMethodDecl *MD = + dyn_cast<CXXMethodDecl>(*Paths.ScratchPath.Decls.first)) { + OverloadedFunctionDecl::function_iterator MatchedDecl; + if (MD->isVirtual() && + !IsOverload(Criteria.Method, MD, MatchedDecl)) { + FoundPathToThisBase = true; + break; + } } ++Paths.ScratchPath.Decls.first; |