forked from OSchip/llvm-project
Replace a cast with a dyn_cast as suggested by Doug.
llvm-svn: 72624
This commit is contained in:
parent
8e2c4f4716
commit
36b75a4619
|
@ -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;
|
||||
|
|
|
@ -118,3 +118,11 @@ void foo(void)
|
|||
B b;
|
||||
}
|
||||
|
||||
struct K {
|
||||
int f;
|
||||
virtual ~K();
|
||||
};
|
||||
|
||||
struct L : public K {
|
||||
void f();
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue