summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-09 20:53:38 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-09 20:53:38 +0000
commit3c7cd6a0c448bb5484f5f6c13cb0938d9e4d7768 (patch)
treed255d158d04a6e1bbf2b0dde7218da4b52316a72 /clang/lib/Sema/SemaTemplate.cpp
parent4444daeec5650c75dbc3cfa9cf503a0ec27ebaf1 (diff)
downloadbcm5719-llvm-3c7cd6a0c448bb5484f5f6c13cb0938d9e4d7768.tar.gz
bcm5719-llvm-3c7cd6a0c448bb5484f5f6c13cb0938d9e4d7768.zip
Specializations cannot be module-hidden. Diagnose attempts to do so.
llvm-svn: 139406
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 4b3f6c45d55..f613ebb36c6 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -4725,6 +4725,7 @@ DeclResult
Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
TagUseKind TUK,
SourceLocation KWLoc,
+ SourceLocation ModulePrivateLoc,
CXXScopeSpec &SS,
TemplateTy TemplateD,
SourceLocation TemplateNameLoc,
@@ -5090,6 +5091,11 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
if (Attr)
ProcessDeclAttributeList(S, Specialization, Attr);
+ if (ModulePrivateLoc.isValid())
+ Diag(Specialization->getLocation(), diag::err_module_private_specialization)
+ << (isPartialSpecialization? 1 : 0)
+ << FixItHint::CreateRemoval(ModulePrivateLoc);
+
// Build the fully-sugared type for this class template
// specialization as the user wrote in the specialization
// itself. This means that we'll pretty-print the type retrieved
OpenPOWER on IntegriCloud