From 4c9131ac2d0a65cb7c0179d438ae56f7978ab012 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 19 Jan 2011 22:11:50 +0000 Subject: [PATCH] Variadic templates are fully implemented. Turn on the __has_feature switch for variadic templates, document their completion, and put the ExtWarn into the c++0x-extensions warning group. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123854 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticCommonKinds.td | 2 +- lib/Lex/PPMacroExpansion.cpp | 2 +- test/Lexer/has_feature_cxx0x.cpp | 5 +++-- www/cxx_status.html | 15 +++++++-------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td index ef5e452e7f..49504e6e22 100644 --- a/include/clang/Basic/DiagnosticCommonKinds.td +++ b/include/clang/Basic/DiagnosticCommonKinds.td @@ -48,7 +48,7 @@ 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 ext_variadic_templates : ExtWarn< - "variadic templates are a C++0x extension">; + "variadic templates are a C++0x extension">, InGroup; // Sema && Lex def ext_longlong : Extension< diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 247bbf47fc..54e4691392 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -560,7 +560,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { //.Case("cxx_lambdas", false) //.Case("cxx_nullptr", false) //.Case("cxx_rvalue_references", false) - //.Case("cxx_variadic_templates", false) + .Case("cxx_variadic_templates", LangOpts.CPlusPlus) .Case("tls", PP.getTargetInfo().isTLSSupported()) .Default(false); } diff --git a/test/Lexer/has_feature_cxx0x.cpp b/test/Lexer/has_feature_cxx0x.cpp index c6c7787276..5b0f79834e 100644 --- a/test/Lexer/has_feature_cxx0x.cpp +++ b/test/Lexer/has_feature_cxx0x.cpp @@ -97,8 +97,9 @@ int variadic_templates(); int no_variadic_templates(); #endif -// CHECK-0X: no_variadic_templates -// CHECK-NO-0X: no_variadic_templates +// CHECK-0X: variadic_templates +// Note: We allow variadic templates in C++98/03 with a warning. +// CHECK-NO-0X: variadic_templates #if __has_feature(cxx_inline_namespaces) diff --git a/www/cxx_status.html b/www/cxx_status.html index eaf951cd72..598ae2ef6b 100644 --- a/www/cxx_status.html +++ b/www/cxx_status.html @@ -441,16 +441,15 @@ welcome!

variadic templates - - - - + + + + 14.6.3 - N2151 - N2080 + N2080 N2087 - N2772 - N2551 + N2242 + N2488 -- 2.40.0