aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-06-16 09:33:39 +0000
committerJohn McCall <rjmccall@apple.com>2010-06-16 09:33:39 +0000
commit52a02758fb81723e16c46721152c6ad0528b2fc3 (patch)
treee05b14c6653bc3a89d943158de50e81d352bdd76
parentd45c93c92e19085b48ff40dad97a44746debfd29 (diff)
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
-rw-r--r--lib/Sema/SemaDecl.cpp2
-rw-r--r--test/SemaCXX/abstract.cpp18
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;
+ }
+}