diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-12-24 00:20:52 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-12-24 00:20:52 +0000 |
commit | 85374738e40a3b5bf078d05787e8fa96fa63c2d0 (patch) | |
tree | 9f22091de872d4cd73fa7f48df8f4acf6e88f09a /lib/Sema/SemaTemplate.cpp | |
parent | 56bc9832bc8f80604bfddc2c93f81537df6930a1 (diff) |
Non-type template parameter packs cannot have default arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122533 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index a487825bb3..ce0132ee81 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -649,6 +649,14 @@ Decl *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, // Check the well-formedness of the default template argument, if provided. if (Default) { + // C++0x [temp.param]p9: + // A default template-argument may be specified for any kind of + // template-parameter that is not a template parameter pack. + if (IsParameterPack) { + Diag(EqualLoc, diag::err_template_param_pack_default_arg); + return Param; + } + // Check for unexpanded parameter packs. if (DiagnoseUnexpandedParameterPack(Default, UPPC_DefaultArgument)) return Param; |