summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-11-26 20:50:40 +0000
committerAnders Carlsson <andersca@mac.com>2009-11-26 20:50:40 +0000
commite985faea49e4f82693b8abbf683579d831e620b0 (patch)
treedf8d0bb108f44fc954be6884e6adc77e7d05cbc6 /clang/lib
parent323bb04ef4179a00bb23c09f65763bb4d0b0a4b5 (diff)
downloadbcm5719-llvm-e985faea49e4f82693b8abbf683579d831e620b0.tar.gz
bcm5719-llvm-e985faea49e4f82693b8abbf683579d831e620b0.zip
Correctly find overridden destructors.
llvm-svn: 89966
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 31c6ab543dd..862fdfeabaf 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2587,10 +2587,23 @@ static bool FindOverriddenMethod(const CXXBaseSpecifier *Specifier,
CXXBasePath &Path,
void *UserData) {
RecordDecl *BaseRecord = Specifier->getType()->getAs<RecordType>()->getDecl();
-
+
FindOverriddenMethodData *Data
= reinterpret_cast<FindOverriddenMethodData*>(UserData);
- for (Path.Decls = BaseRecord->lookup(Data->Method->getDeclName());
+
+ DeclarationName Name = Data->Method->getDeclName();
+
+ // FIXME: Do we care about other names here too?
+ if (Name.getNameKind() == DeclarationName::CXXDestructorName) {
+ // We really want to find the base class constructor here.
+ QualType T = Data->S->Context.getTypeDeclType(BaseRecord);
+ CanQualType CT = Data->S->Context.getCanonicalType(T);
+
+ DeclarationName Name =
+ Data->S->Context.DeclarationNames.getCXXDestructorName(CT);
+ }
+
+ for (Path.Decls = BaseRecord->lookup(Name);
Path.Decls.first != Path.Decls.second;
++Path.Decls.first) {
if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(*Path.Decls.first)) {
OpenPOWER on IntegriCloud