aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/CXXInheritance.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-11-10 07:24:09 +0000
committerDouglas Gregor <dgregor@apple.com>2012-11-10 07:24:09 +0000
commit229d47aef27e6f65fe4dc3beb22f622dd81104ad (patch)
treef36e3c95a4e160a0bdc651cd679d657bd836e0dc /lib/AST/CXXInheritance.cpp
parent463eb89d5e36b05d74c14b937384076d745b3b84 (diff)
Rework my implementation of circular-reference finding to not use
CXXRecordDecl::forallBases, which does *not* do what I need. Fixes the failure introduced in r167651. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167668 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/CXXInheritance.cpp')
-rw-r--r--lib/AST/CXXInheritance.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/AST/CXXInheritance.cpp b/lib/AST/CXXInheritance.cpp
index 6e91f3f910..213b214a4e 100644
--- a/lib/AST/CXXInheritance.cpp
+++ b/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;