aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-09 18:32:39 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-09 18:32:39 +0000
commit6311d2bb3db1ec1064f45a14983ae5806adc676a (patch)
tree5cb041fdf6634ccfabccd3d7122c3d7788ade952 /lib/Sema/SemaTemplate.cpp
parentbbcb7ea8a062a8f1d5cb504e4518a5d4fbab873a (diff)
Propagate __module_private__ from previous declarations to later
declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139380 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 80e972fae7..eb199aced4 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -945,7 +945,7 @@ Sema::CheckClassTemplate(Scope *S, unsigned TagSpec, TagUseKind TUK,
// definition, as part of error recovery?
return true;
}
- }
+ }
} else if (PrevDecl && PrevDecl->isTemplateParameter()) {
// Maybe we will complain about the shadowed template parameter.
DiagnoseTemplateParameterShadow(NameLoc, PrevDecl);
@@ -999,8 +999,10 @@ Sema::CheckClassTemplate(Scope *S, unsigned TagSpec, TagUseKind TUK,
DeclarationName(Name), TemplateParams,
NewClass, PrevClassTemplate);
NewClass->setDescribedClassTemplate(NewTemplate);
-
- if (IsModulePrivate)
+
+ if (PrevClassTemplate && PrevClassTemplate->isModulePrivate()) {
+ NewTemplate->setModulePrivate();
+ } else if (IsModulePrivate)
NewTemplate->setModulePrivate();
// Build the type for the class template declaration now.