From: John McCall Date: Wed, 16 Jun 2010 09:33:39 +0000 (+0000) Subject: Fix the build. Using declarations should not be considering when looking X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52a02758fb81723e16c46721152c6ad0528b2fc3;p=clang Fix the build. Using declarations should not be considering when looking for overridden virtual methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106096 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index ddc5ef108a..f10927d18e 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -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(D)) { if (MD->isVirtual() && !Data->S->IsOverload(Data->Method, MD, false)) return true; diff --git a/test/SemaCXX/abstract.cpp b/test/SemaCXX/abstract.cpp index 3e61cc386e..f64fda4877 100644 --- a/test/SemaCXX/abstract.cpp +++ b/test/SemaCXX/abstract.cpp @@ -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; + } +}