aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-02-04 03:57:22 +0000
committerDouglas Gregor <dgregor@apple.com>2011-02-04 03:57:22 +0000
commitee5d21f63714459f39e0be28fec9dbecf0720505 (patch)
tree03158b5af58ce3e36c961ec82a7fdb2ddae7932f /lib/Sema/SemaTemplate.cpp
parent398c610b16728b4398214367dd0effd9d2e61340 (diff)
When a function template's template parameter has a default argument,
it's okay for the following template parameters to not have default arguments (since those template parameters can still be deduced). Also, downgrade the error about default template arguments in function templates to an extension warning, since this is a harmless C++0x extension. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 00f490cfad..f7060f03a3 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -1052,7 +1052,7 @@ static bool DiagnoseDefaultTemplateArgument(Sema &S,
// (This sentence is not in C++0x, per DR226).
if (!S.getLangOptions().CPlusPlus0x)
S.Diag(ParamLoc,
- diag::err_template_parameter_default_in_function_template)
+ diag::ext_template_parameter_default_in_function_template)
<< DefArgRange;
return false;
@@ -1315,7 +1315,7 @@ bool Sema::CheckTemplateParameterList(TemplateParameterList *NewParams,
Diag(NewDefaultLoc, diag::err_template_param_default_arg_redefinition);
Diag(OldDefaultLoc, diag::note_template_param_prev_default_arg);
Invalid = true;
- } else if (MissingDefaultArg) {
+ } else if (MissingDefaultArg && TPC != TPC_FunctionTemplate) {
// C++ [temp.param]p11:
// If a template-parameter of a class template has a default
// template-argument, each subsequent template-parameter shall either