From: Douglas Gregor Date: Wed, 19 Jan 2011 21:59:15 +0000 (+0000) Subject: Downgrade the "variadic templates are a C++0x feature" error to an X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ce5f5221217b64193799c2a4d5aa84432d3fba4;p=clang 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 . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123852 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td index 1374402012..ef5e452e7f 100644 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ b/include/clang/Basic/DiagnosticCommonKinds.td @@ -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< diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 870a0e0205..9e7d0a5761 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -1825,8 +1825,6 @@ def ext_template_outside_of_template : ExtWarn< "'template' keyword outside of a template">, InGroup; // 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< diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index 05cdd5c87f..d150260709 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -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. diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index c3fac5f373..9a75d3604d 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -1943,7 +1943,7 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S, if (T->containsUnexpandedParameterPack()) T = Context.getPackExpansionType(T, llvm::Optional()); else if (!getLangOptions().CPlusPlus0x) - Diag(D.getEllipsisLoc(), diag::err_variadic_templates); + Diag(D.getEllipsisLoc(), diag::ext_variadic_templates); break; case Declarator::FileContext: