diff options
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 2 | ||||
-rw-r--r-- | test/SemaCXX/abstract.cpp | 18 |
2 files changed, 19 insertions, 1 deletions
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<CXXMethodDecl>(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; + } +} |