aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/CXXInheritance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/CXXInheritance.cpp')
-rw-r--r--lib/AST/CXXInheritance.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/AST/CXXInheritance.cpp b/lib/AST/CXXInheritance.cpp
index 7208328692..7d9e553eaf 100644
--- a/lib/AST/CXXInheritance.cpp
+++ b/lib/AST/CXXInheritance.cpp
@@ -215,10 +215,13 @@ bool CXXRecordDecl::lookupInBases(BaseMatchesCallback *BaseMatches,
Paths.ScratchPath.Access
= MergeAccess(AccessToHere, BaseSpec->getAccessSpecifier());
}
-
+
+ // Track whether there's a path involving this specific base.
+ bool FoundPathThroughBase = false;
+
if (BaseMatches(BaseSpec, Paths.ScratchPath, UserData)) {
// We've found a path that terminates at this base.
- FoundPath = true;
+ FoundPath = FoundPathThroughBase = true;
if (Paths.isRecordingPaths()) {
// We have a path. Make a copy of it before moving on.
Paths.Paths.push_back(Paths.ScratchPath);
@@ -240,7 +243,7 @@ bool CXXRecordDecl::lookupInBases(BaseMatchesCallback *BaseMatches,
// There is a path to a base class that meets the criteria. If we're
// not collecting paths or finding ambiguities, we're done.
- FoundPath = true;
+ FoundPath = FoundPathThroughBase = true;
if (!Paths.isFindingAmbiguities())
return FoundPath;
}
@@ -253,7 +256,7 @@ bool CXXRecordDecl::lookupInBases(BaseMatchesCallback *BaseMatches,
}
// If we set a virtual earlier, and this isn't a path, forget it again.
- if (SetVirtual && !FoundPath) {
+ if (SetVirtual && !FoundPathThroughBase) {
Paths.DetectedVirtual = 0;
}
}