diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-09-26 03:49:48 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-09-26 03:49:48 +0000 |
commit | 10b55fc85ef3af114cca7c55b46b95da800a4bb3 (patch) | |
tree | ed06d60edbc898c56c22ac7d42730a85f882a70f /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | fde9485297895ac96ece2234021ec72270c703e7 (diff) | |
download | bcm5719-llvm-10b55fc85ef3af114cca7c55b46b95da800a4bb3.tar.gz bcm5719-llvm-10b55fc85ef3af114cca7c55b46b95da800a4bb3.zip |
If a partial specialization of a member template is declared within a class
template and defined outside it, don't instantiate it twice when instantiating
the surrounding class template specialization. That would cause us to reject
the code because we think two partial specializations instantiated to produce
the same signature.
llvm-svn: 191418
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index e03e8c55c9a..9779aa64ae5 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -923,7 +923,7 @@ Decl *TemplateDeclInstantiator::VisitClassTemplateDecl(ClassTemplateDecl *D) { SmallVector<ClassTemplatePartialSpecializationDecl *, 4> PartialSpecs; D->getPartialSpecializations(PartialSpecs); for (unsigned I = 0, N = PartialSpecs.size(); I != N; ++I) - if (PartialSpecs[I]->isOutOfLine()) + if (PartialSpecs[I]->getFirstDeclaration()->isOutOfLine()) OutOfLinePartialSpecs.push_back(std::make_pair(Inst, PartialSpecs[I])); } @@ -1004,7 +1004,7 @@ Decl *TemplateDeclInstantiator::VisitVarTemplateDecl(VarTemplateDecl *D) { SmallVector<VarTemplatePartialSpecializationDecl *, 4> PartialSpecs; D->getPartialSpecializations(PartialSpecs); for (unsigned I = 0, N = PartialSpecs.size(); I != N; ++I) - if (PartialSpecs[I]->isOutOfLine()) + if (PartialSpecs[I]->getFirstDeclaration()->isOutOfLine()) OutOfLineVarPartialSpecs.push_back( std::make_pair(Inst, PartialSpecs[I])); } |