summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-07 08:29:39 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-07 08:29:39 +0000
commit8e0317bf05c6a67461e7b842bcabd1b86e2d389c (patch)
treedfcc6d6e5a74e5d27b707c4d07476cac02889855 /clang/lib/AST
parent82fccd014a4f2e1fcbde11ed1c39c7fc70f28752 (diff)
downloadbcm5719-llvm-8e0317bf05c6a67461e7b842bcabd1b86e2d389c.tar.gz
bcm5719-llvm-8e0317bf05c6a67461e7b842bcabd1b86e2d389c.zip
Instantiated or specialized class templates never have a key function. This (and the previous check-in) fixes PR5557.
llvm-svn: 90753
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/RecordLayoutBuilder.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp
index 550a32b0d05..f7da8903504 100644
--- a/clang/lib/AST/RecordLayoutBuilder.cpp
+++ b/clang/lib/AST/RecordLayoutBuilder.cpp
@@ -720,6 +720,11 @@ ASTRecordLayoutBuilder::ComputeKeyFunction(const CXXRecordDecl *RD) {
if (!RD->isPolymorphic())
return 0;
+ // A class template specialization or instantation does not have a key
+ // function.
+ if (RD->getTemplateSpecializationKind() != TSK_Undeclared)
+ return 0;
+
for (CXXRecordDecl::method_iterator I = RD->method_begin(),
E = RD->method_end(); I != E; ++I) {
const CXXMethodDecl *MD = *I;
OpenPOWER on IntegriCloud