diff options
| author | Douglas Gregor <dgregor@apple.com> | 2011-02-04 03:57:22 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2011-02-04 03:57:22 +0000 |
| commit | 8b481d8ac2af1ac2af029d0773938d7bff364737 (patch) | |
| tree | 4e56180df1d9f08fb5a6f4cd80aae44b3919fcd6 /clang/lib | |
| parent | a6aa87898b0f0d6b7d0e5477dffc2aa314c18a7e (diff) | |
| download | bcm5719-llvm-8b481d8ac2af1ac2af029d0773938d7bff364737.tar.gz bcm5719-llvm-8b481d8ac2af1ac2af029d0773938d7bff364737.zip | |
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.
llvm-svn: 124855
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 00f490cfad7..f7060f03a3b 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/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 |

