diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-12-21 08:14:57 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-12-21 08:14:57 +0000 |
commit | ec9518be89c938b0ec2db2f5b9c83ce9605d3026 (patch) | |
tree | df949fe7856fe043869e263c4ec0487137264901 /clang/lib/Sema | |
parent | 7ecd19ecded872b97e3fcc839ba9d3516d153d8e (diff) | |
download | bcm5719-llvm-ec9518be89c938b0ec2db2f5b9c83ce9605d3026.tar.gz bcm5719-llvm-ec9518be89c938b0ec2db2f5b9c83ce9605d3026.zip |
A class template partial specialization cannot be a friend. Fixes PR8649.
llvm-svn: 122325
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 923e7cc30f3..ca2a43b7295 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -4087,6 +4087,12 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec, if (TemplateParams && TemplateParams->size() > 0) { isPartialSpecialization = true; + if (TUK == TUK_Friend) { + Diag(KWLoc, diag::err_partial_specialization_friend) + << SourceRange(LAngleLoc, RAngleLoc); + return true; + } + // C++ [temp.class.spec]p10: // The template parameter list of a specialization shall not // contain default template argument values. |