Downgrade the "variadic templates are a C++0x feature" error to an

ExtWarn. We want variadic templates to be usable in libc++/libstdc++
headers even when we're in C++98/03 mode, since it's the only clean
way to implement TR1 <functional>.

llvm-svn: 123852
This commit is contained in:
Douglas Gregor 2011-01-19 21:59:15 +00:00
parent f144f4f5c9
commit b25d8c3af4
4 changed files with 5 additions and 7 deletions

View File

@ -47,8 +47,8 @@ def err_param_redefinition : Error<"redefinition of parameter %0">;
def err_invalid_storage_class_in_func_decl : Error<
"invalid storage class specifier in function declarator">;
def err_expected_namespace_name : Error<"expected namespace name">;
def err_variadic_templates : Error<
"variadic templates are only allowed in C++0x">;
def ext_variadic_templates : ExtWarn<
"variadic templates are a C++0x extension">;
// Sema && Lex
def ext_longlong : Extension<

View File

@ -1825,8 +1825,6 @@ def ext_template_outside_of_template : ExtWarn<
"'template' keyword outside of a template">, InGroup<CXX0x>;
// C++0x Variadic Templates
def err_variadic_templates_unsupported : Error<
"variadic templates are not yet implemented">;
def err_template_param_pack_default_arg : Error<
"template parameter pack cannot have a default argument">;
def err_template_param_pack_must_be_last_template_parameter : Error<

View File

@ -467,7 +467,7 @@ Decl *Parser::ParseTypeParameter(unsigned Depth, unsigned Position) {
EllipsisLoc = ConsumeToken();
if (!getLang().CPlusPlus0x)
Diag(EllipsisLoc, diag::err_variadic_templates);
Diag(EllipsisLoc, diag::ext_variadic_templates);
}
// Grab the template parameter name (if given)
@ -539,7 +539,7 @@ Parser::ParseTemplateTemplateParameter(unsigned Depth, unsigned Position) {
EllipsisLoc = ConsumeToken();
if (!getLang().CPlusPlus0x)
Diag(EllipsisLoc, diag::err_variadic_templates);
Diag(EllipsisLoc, diag::ext_variadic_templates);
}
// Get the identifier, if given.

View File

@ -1943,7 +1943,7 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
if (T->containsUnexpandedParameterPack())
T = Context.getPackExpansionType(T, llvm::Optional<unsigned>());
else if (!getLangOptions().CPlusPlus0x)
Diag(D.getEllipsisLoc(), diag::err_variadic_templates);
Diag(D.getEllipsisLoc(), diag::ext_variadic_templates);
break;
case Declarator::FileContext: