From dca0c7a5fbeafe27bcfc31703e00bf99c19533ea Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 27 Sep 2013 20:19:41 +0000 Subject: [PATCH] Mark variable template implementation as complete. Nearly all of the credit here goes to Larisse Voufo. llvm-svn: 191549 --- clang/lib/Lex/PPMacroExpansion.cpp | 3 ++- clang/test/Lexer/has_extension_cxx.cpp | 11 ++++++----- clang/test/Lexer/has_feature_cxx0x.cpp | 10 ++++++++++ clang/www/cxx_status.html | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 865a89e8962f..2b6f33951b19 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -961,7 +961,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { .Case("cxx_relaxed_constexpr", LangOpts.CPlusPlus1y) .Case("cxx_return_type_deduction", LangOpts.CPlusPlus1y) //.Case("cxx_runtime_array", LangOpts.CPlusPlus1y) - //.Case("cxx_variable_templates", LangOpts.CPlusPlus1y) + .Case("cxx_variable_templates", LangOpts.CPlusPlus1y) // Type traits .Case("has_nothrow_assign", LangOpts.CPlusPlus) .Case("has_nothrow_copy", LangOpts.CPlusPlus) @@ -1036,6 +1036,7 @@ static bool HasExtension(const Preprocessor &PP, const IdentifierInfo *II) { .Case("cxx_rvalue_references", LangOpts.CPlusPlus) // C++1y features supported by other languages as extensions. .Case("cxx_binary_literals", true) + .Case("cxx_variable_templates", true) .Default(false); } diff --git a/clang/test/Lexer/has_extension_cxx.cpp b/clang/test/Lexer/has_extension_cxx.cpp index 68b542fb2975..6646a5ab5817 100644 --- a/clang/test/Lexer/has_extension_cxx.cpp +++ b/clang/test/Lexer/has_extension_cxx.cpp @@ -40,16 +40,17 @@ int has_reference_qualified_functions(); int has_rvalue_references(); #endif +// CHECK: has_local_type_template_args #if __has_extension(cxx_local_type_template_args) int has_local_type_template_args(); -#else -int no_local_type_template_args(); #endif -// CHECK: has_local_type_template_args - +// CHECK: has_binary_literals #if __has_extension(cxx_binary_literals) int has_binary_literals(); #endif -// CHECK: has_binary_literals +// CHECK: has_variable_templates +#if __has_extension(cxx_variable_templates) +int has_variable_templates(); +#endif diff --git a/clang/test/Lexer/has_feature_cxx0x.cpp b/clang/test/Lexer/has_feature_cxx0x.cpp index 2dc2abe87cf2..821b5b5f5704 100644 --- a/clang/test/Lexer/has_feature_cxx0x.cpp +++ b/clang/test/Lexer/has_feature_cxx0x.cpp @@ -376,3 +376,13 @@ int no_relaxed_constexpr(); // CHECK-1Y: has_relaxed_constexpr // CHECK-11: no_relaxed_constexpr // CHECK-NO-11: no_relaxed_constexpr + +#if __has_feature(cxx_variable_templates) +int has_variable_templates(); +#else +int no_variable_templates(); +#endif + +// CHECK-1Y: has_variable_templates +// CHECK-11: no_variable_templates +// CHECK-NO-11: no_variable_templates diff --git a/clang/www/cxx_status.html b/clang/www/cxx_status.html index f28d7f1ecd4c..3bcc3f8346d3 100644 --- a/clang/www/cxx_status.html +++ b/clang/www/cxx_status.html @@ -451,7 +451,7 @@ available.

Variable templates N3651 - Partial + SVN Relaxing requirements on constexpr functions