diff options
author | John McCall <rjmccall@apple.com> | 2010-02-09 00:57:12 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-02-09 00:57:12 +0000 |
commit | ed814cc4cd2bd4d32cbb4bfde3cc59ccae723a92 (patch) | |
tree | 09c1ddc4f675ff59603f2194321a1b82144103a6 /lib/AST/CXXInheritance.cpp | |
parent | 2c79281ef66cb5001f0ebadf6b317250c21a1c01 (diff) |
Reset the found-virtual-base state unless the *current* base produces a path,
not *any* base up to now has produced a path. Fixes PR 6254.
I'll do the access-control part of this patch RSN.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95638 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/CXXInheritance.cpp')
-rw-r--r-- | lib/AST/CXXInheritance.cpp | 11 |
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; } } |