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
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 562b2da..550a144 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2145,23 +2145,11 @@
     // Look for virtual methods in base classes that this method might override.
 
     BasePaths Paths;
-    // FIXME: This will not include hidden member functions.
     if (LookupInBases(cast<CXXRecordDecl>(DC), 
-                      MemberLookupCriteria(Name, LookupMemberName, 
-                                           // FIXME: Shouldn't IDNS_Member be
-                                           // enough here?
-                                           Decl::IDNS_Member | 
-                                           Decl::IDNS_Ordinary), Paths)) {
+                      MemberLookupCriteria(NewMD), Paths)) {
       for (BasePaths::decl_iterator I = Paths.found_decls_begin(), 
            E = Paths.found_decls_end(); I != E; ++I) {
         if (CXXMethodDecl *OldMD = dyn_cast<CXXMethodDecl>(*I)) {
-          OverloadedFunctionDecl::function_iterator MatchedDecl;
-          // FIXME: Is this OK? Should it be done by LookupInBases?
-          if (IsOverload(NewMD, OldMD, MatchedDecl))
-            continue;
-          if (!OldMD->isVirtual())
-            continue;
-         
           if (!CheckOverridingFunctionReturnType(NewMD, OldMD))
             NewMD->addOverriddenMethod(OldMD);
         }