summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/CXXInheritance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/CXXInheritance.cpp')
-rw-r--r--clang/lib/AST/CXXInheritance.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/AST/CXXInheritance.cpp b/clang/lib/AST/CXXInheritance.cpp
index 6e91f3f9105..213b214a4e4 100644
--- a/clang/lib/AST/CXXInheritance.cpp
+++ b/clang/lib/AST/CXXInheritance.cpp
@@ -123,8 +123,7 @@ bool CXXRecordDecl::isProvablyNotDerivedFrom(const CXXRecordDecl *Base) const {
bool CXXRecordDecl::forallBases(ForallBasesCallback *BaseMatches,
void *OpaqueData,
- bool AllowShortCircuit,
- bool VisitDependent) const {
+ bool AllowShortCircuit) const {
SmallVector<const CXXRecordDecl*, 8> Queue;
const CXXRecordDecl *Record = this;
@@ -132,14 +131,15 @@ bool CXXRecordDecl::forallBases(ForallBasesCallback *BaseMatches,
while (true) {
for (CXXRecordDecl::base_class_const_iterator
I = Record->bases_begin(), E = Record->bases_end(); I != E; ++I) {
- CXXRecordDecl *Base = I->getType()->getAsCXXRecordDecl();
- if (!Base || (!VisitDependent && I->getType()->isDependentType())) {
+ const RecordType *Ty = I->getType()->getAs<RecordType>();
+ if (!Ty) {
if (AllowShortCircuit) return false;
AllMatches = false;
continue;
}
- Base = Base->getDefinition();
+ CXXRecordDecl *Base =
+ cast_or_null<CXXRecordDecl>(Ty->getDecl()->getDefinition());
if (!Base) {
if (AllowShortCircuit) return false;
AllMatches = false;
OpenPOWER on IntegriCloud