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 | 36b75a4619e870c75b7b95eb60bdeb4cbee2b54f (patch) | |
tree | 61e494310a8d5bfaf897d8ffad9989e14376c395 /clang/lib/Sema/SemaInherit.cpp | |
parent | 8e2c4f4716300c4e78ac67ae5c9fa7713a1c0c3d (diff) | |
download | bcm5719-llvm-36b75a4619e870c75b7b95eb60bdeb4cbee2b54f.tar.gz bcm5719-llvm-36b75a4619e870c75b7b95eb60bdeb4cbee2b54f.zip |
Replace a cast with a dyn_cast as suggested by Doug.
llvm-svn: 72624
Diffstat (limited to 'clang/lib/Sema/SemaInherit.cpp')
-rw-r--r-- | clang/lib/Sema/SemaInherit.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaInherit.cpp b/clang/lib/Sema/SemaInherit.cpp index 1eccc1f193f..1b968f0fbcc 100644 --- a/clang/lib/Sema/SemaInherit.cpp +++ b/clang/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; |