summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-01-04 23:45:01 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-01-04 23:45:01 +0000
commitece4758bf28b5be96ef0123ad79456a13e8518a1 (patch)
tree7e0b2b55ba718ac6bc98546707624ba8bdfb40db /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parentdd9c27b3bf77b947ba0bb08ed1ba1ae673b9f067 (diff)
downloadbcm5719-llvm-ece4758bf28b5be96ef0123ad79456a13e8518a1.tar.gz
bcm5719-llvm-ece4758bf28b5be96ef0123ad79456a13e8518a1.zip
Only instantiate members of nested classes in local classes once, rather than once per enclosing class.
llvm-svn: 291034
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 7328dcb8760..3cc938106d8 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -1470,8 +1470,11 @@ Decl *TemplateDeclInstantiator::VisitCXXRecordDecl(CXXRecordDecl *D) {
TSK_ImplicitInstantiation,
/*Complain=*/true);
- SemaRef.InstantiateClassMembers(D->getLocation(), Record, TemplateArgs,
- TSK_ImplicitInstantiation);
+ // For nested local classes, we will instantiate the members when we
+ // reach the end of the outermost (non-nested) local class.
+ if (!D->isCXXClassMember())
+ SemaRef.InstantiateClassMembers(D->getLocation(), Record, TemplateArgs,
+ TSK_ImplicitInstantiation);
// This class may have local implicit instantiations that need to be
// performed within this scope.
OpenPOWER on IntegriCloud