[cfe-commits] r123852 - in /cfe/trunk: include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/DiagnosticSemaKinds.td lib/Parse/ParseTemplate.cpp lib/Sema/SemaType.cpp
Douglas Gregor
dgregor at apple.com
Wed Jan 19 13:59:15 PST 2011
Author: dgregor
Date: Wed Jan 19 15:59:15 2011
New Revision: 123852
URL: http://llvm.org/viewvc/llvm-project?rev=123852&view=rev
Log:
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>.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Parse/ParseTemplate.cpp
cfe/trunk/lib/Sema/SemaType.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td?rev=123852&r1=123851&r2=123852&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td Wed Jan 19 15:59:15 2011
@@ -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<
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=123852&r1=123851&r2=123852&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Jan 19 15:59:15 2011
@@ -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<
Modified: cfe/trunk/lib/Parse/ParseTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTemplate.cpp?rev=123852&r1=123851&r2=123852&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTemplate.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTemplate.cpp Wed Jan 19 15:59:15 2011
@@ -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.
Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=123852&r1=123851&r2=123852&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Wed Jan 19 15:59:15 2011
@@ -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:
More information about the cfe-commits
mailing list