[PATCH] Have `__have_extension(cxx_variadic_templates)` return true for any C++ standard.

Eric Fiselier eric at efcs.ca
Thu Apr 30 18:59:10 PDT 2015


Hi rsmith, majnemer,

Currently `__has_extension(cxx_variadic_templates)` always evaluates to 0 even though the front-end accepts the extension.

http://reviews.llvm.org/D9423

Files:
  lib/Lex/PPMacroExpansion.cpp
  test/Lexer/has_extension_cxx.cpp

Index: lib/Lex/PPMacroExpansion.cpp
===================================================================
--- lib/Lex/PPMacroExpansion.cpp
+++ lib/Lex/PPMacroExpansion.cpp
@@ -1236,6 +1236,7 @@
            .Case("cxx_override_control", LangOpts.CPlusPlus)
            .Case("cxx_range_for", LangOpts.CPlusPlus)
            .Case("cxx_reference_qualified_functions", LangOpts.CPlusPlus)
+           .Case("cxx_variadic_templates", LangOpts.CPlusPlus)
            .Case("cxx_rvalue_references", LangOpts.CPlusPlus)
            // C++1y features supported by other languages as extensions.
            .Case("cxx_binary_literals", true)
Index: test/Lexer/has_extension_cxx.cpp
===================================================================
--- test/Lexer/has_extension_cxx.cpp
+++ test/Lexer/has_extension_cxx.cpp
@@ -41,6 +41,11 @@
 int has_rvalue_references();
 #endif
 
+// CHECK: has_variadic_templates
+#if __has_extension(cxx_variadic_templates)
+int has_variadic_templates();
+#endif
+
 // CHECK: has_local_type_template_args
 #if __has_extension(cxx_local_type_template_args)
 int has_local_type_template_args();

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9423.24787.patch
Type: text/x-patch
Size: 1121 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150501/14a3dcd5/attachment.bin>


More information about the cfe-commits mailing list