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
diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td
index 1374402..ef5e452 100644
--- a/clang/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td
@@ -47,8 +47,8 @@
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/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 870a0e0..9e7d0a5 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -1825,8 +1825,6 @@
"'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<
diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp
index 05cdd5c..d150260 100644
--- a/clang/lib/Parse/ParseTemplate.cpp
+++ b/clang/lib/Parse/ParseTemplate.cpp
@@ -467,7 +467,7 @@
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 @@
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/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index c3fac5f..9a75d36 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -1943,7 +1943,7 @@
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: