]> granicus.if.org Git - clang/commitdiff
Fix the build. Using declarations should not be considering when looking
authorJohn McCall <rjmccall@apple.com>
Wed, 16 Jun 2010 09:33:39 +0000 (09:33 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 16 Jun 2010 09:33:39 +0000 (09:33 +0000)
for overridden virtual methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106096 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp
test/SemaCXX/abstract.cpp

index ddc5ef108a811af7808d8e3f9eb9fe548724940c..f10927d18e987e46fbd522a05592b439403501f8 100644 (file)
@@ -2873,7 +2873,7 @@ static bool FindOverriddenMethod(const CXXBaseSpecifier *Specifier,
   for (Path.Decls = BaseRecord->lookup(Name);
        Path.Decls.first != Path.Decls.second;
        ++Path.Decls.first) {
-    NamedDecl *D = (*Path.Decls.first)->getUnderlyingDecl();
+    NamedDecl *D = *Path.Decls.first;
     if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D)) {
       if (MD->isVirtual() && !Data->S->IsOverload(Data->Method, MD, false))
         return true;
index 3e61cc386eb81d3af1e21b6b75a114c2fd56d4d7..f64fda4877e073862dcf953b03f93067efd9e178 100644 (file)
@@ -168,3 +168,21 @@ namespace PureImplicit {
   struct D : C {};
   D y;
 }
+
+namespace test1 {
+  struct A {
+    virtual void foo() = 0;
+  };
+
+  struct B : A {
+    using A::foo;
+  };
+
+  struct C : B {
+    void foo();
+  };
+
+  void test() {
+    C c;
+  }
+}