diff options
author | Anders Carlsson <andersca@mac.com> | 2009-05-30 00:52:53 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-05-30 00:52:53 +0000 |
commit | d12ef8d142868889867f9dd968b5f3ea02d463c1 (patch) | |
tree | a179abe7ca42a72745c60e7cbac09d36440d755d /lib/Sema/SemaInherit.cpp | |
parent | db23b154bb62e95e63c6412965835a510c7771d1 (diff) |
Add a member lookup criteria constructor for searching for overridden virtual member functions. Use this instead of regular name lookup when checking for overriding functions so we will see declarations that would otherwise be hidden. Fixes 6902298.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInherit.cpp')
-rw-r--r-- | lib/Sema/SemaInherit.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Sema/SemaInherit.cpp b/lib/Sema/SemaInherit.cpp index 5eef1eb4c0..1eccc1f193 100644 --- a/lib/Sema/SemaInherit.cpp +++ b/lib/Sema/SemaInherit.cpp @@ -191,6 +191,22 @@ bool Sema::LookupInBases(CXXRecordDecl *Class, ++Paths.ScratchPath.Decls.first; } break; + case MemberLookupCriteria::LK_OverriddenMember: + 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; + } + + ++Paths.ScratchPath.Decls.first; + } + break; } if (FoundPathToThisBase) { |