From 5cdfd15e320bb49cb3351f31c9169ab85c37dbc2 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Wed, 15 Jan 2014 04:11:24 +0000 Subject: [PATCH] Fix cxx_variable_templates feature check and documentation This C++ feature has been marked complete since r191549, but the documentation claimed it wasn't supported at all and the extension check misreported it as being available in C. No regression test; this was a short-lived typo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199292 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LanguageExtensions.rst | 1 - lib/Lex/PPMacroExpansion.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/LanguageExtensions.rst b/docs/LanguageExtensions.rst index 682cc9843f..24ef8550c9 100644 --- a/docs/LanguageExtensions.rst +++ b/docs/LanguageExtensions.rst @@ -873,7 +873,6 @@ C++1y variable templates Use ``__has_feature(cxx_variable_templates)`` or ``__has_extension(cxx_variable_templates)`` to determine if support for templated variable declarations is enabled. -Clang does not yet support this feature. C11 --- diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index c6559b460b..721760afa0 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -1039,7 +1039,7 @@ static bool HasExtension(const Preprocessor &PP, const IdentifierInfo *II) { // C++1y features supported by other languages as extensions. .Case("cxx_binary_literals", true) .Case("cxx_init_captures", LangOpts.CPlusPlus11) - .Case("cxx_variable_templates", true) + .Case("cxx_variable_templates", LangOpts.CPlusPlus) .Default(false); } -- 2.40.0