summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-03-27 00:41:57 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-03-27 00:41:57 +0000
commitbe3980b73c6c48832ed3ffc6760f0080e0217cbb (patch)
tree8bbffa80b54fe03c222cadec48ae1df45fc1862f /clang/lib/Sema/SemaDecl.cpp
parent3cd2cabf5076d138a6685b9f99c559fa0402adde (diff)
downloadbcm5719-llvm-be3980b73c6c48832ed3ffc6760f0080e0217cbb.tar.gz
bcm5719-llvm-be3980b73c6c48832ed3ffc6760f0080e0217cbb.zip
[modules] Handle defining a class template on top of an existing imported-but-not-visible definition.
llvm-svn: 233341
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index ffd22390ee3..e9c40aa2e5d 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -11297,7 +11297,8 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
ModulePrivateLoc,
/*FriendLoc*/SourceLocation(),
TemplateParameterLists.size()-1,
- TemplateParameterLists.data());
+ TemplateParameterLists.data(),
+ SkipBody);
return Result.get();
} else {
// The "template<>" header is extraneous.
@@ -11696,8 +11697,9 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
TSK_ExplicitSpecialization;
}
+ NamedDecl *Hidden = nullptr;
if (SkipBody && getLangOpts().CPlusPlus &&
- !hasVisibleDefinition(Def, &Def)) {
+ !hasVisibleDefinition(Def, &Hidden)) {
// There is a definition of this tag, but it is not visible. We
// explicitly make use of C++'s one definition rule here, and
// assume that this definition is identical to the hidden one
@@ -11705,8 +11707,8 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
// use it in place of this one.
*SkipBody = true;
if (auto *Listener = getASTMutationListener())
- Listener->RedefinedHiddenDefinition(Def, KWLoc);
- Def->setHidden(false);
+ Listener->RedefinedHiddenDefinition(Hidden, KWLoc);
+ Hidden->setHidden(false);
return Def;
} else if (!IsExplicitSpecializationAfterInstantiation) {
// A redeclaration in function prototype scope in C isn't
OpenPOWER on IntegriCloud