diff options
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; |