]> granicus.if.org Git - clang/commitdiff
Downgrade the "variadic templates are a C++0x feature" error to an
authorDouglas Gregor <dgregor@apple.com>
Wed, 19 Jan 2011 21:59:15 +0000 (21:59 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 19 Jan 2011 21:59:15 +0000 (21:59 +0000)
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>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123852 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticCommonKinds.td
include/clang/Basic/DiagnosticSemaKinds.td
lib/Parse/ParseTemplate.cpp
lib/Sema/SemaType.cpp

index 1374402012dd97eda383a245f63b657ff486ac73..ef5e452e7f4defc517b427b9c5376b30b742f9e4 100644 (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<
index 870a0e0205c2c370a9141b65562e748fcfbdd2e7..9e7d0a57612f0b3e6ad1c0b4eb4addbfc3367397 100644 (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<
index 05cdd5c87f02f4dee29151a1db5ea7ce1e9faaf8..d150260709ea40f5d39eb6d362c9d637677c7d6b 100644 (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.
index c3fac5f37339324f5842906376ab6bcd09bcac57..9a75d3604d644bb462f98da308b8a5938133ce7c 100644 (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: