]> granicus.if.org Git - clang/commitdiff
Mark P0127R3 as done, and replace its __has_feature check with the corresponding...
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 29 Sep 2016 00:08:05 +0000 (00:08 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 29 Sep 2016 00:08:05 +0000 (00:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282652 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/InitPreprocessor.cpp
lib/Lex/PPMacroExpansion.cpp
test/Lexer/cxx-features.cpp
www/cxx_status.html

index 0ffc0c6ee60b93597b0e1a56b4e15db9a50a5b73..7d15e4cd589c632c11544f390be75ea642fd21d9 100644 (file)
@@ -505,7 +505,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
     //Builder.defineMacro("__cpp_noexcept_function_type", "201510");
     Builder.defineMacro("__cpp_capture_star_this", "201603");
     Builder.defineMacro("__cpp_if_constexpr", "201606");
-    //Builder.defineMacro("__cpp_template_auto", "201606");
+    Builder.defineMacro("__cpp_template_auto", "201606");
     Builder.defineMacro("__cpp_namespace_attributes", "201411");
     Builder.defineMacro("__cpp_enumerator_attributes", "201411");
     Builder.defineMacro("__cpp_nested_namespace_definitions", "201411");
index 1be1801ac2fe290bc1b3ece7c6bd12b6e753df13..940192bafb7bcec1d5cdfcc4ea2caa6591167647 100644 (file)
@@ -1192,7 +1192,7 @@ static bool HasFeature(const Preprocessor &PP, StringRef Feature) {
       .Case("cxx_unrestricted_unions", LangOpts.CPlusPlus11)
       .Case("cxx_user_literals", LangOpts.CPlusPlus11)
       .Case("cxx_variadic_templates", LangOpts.CPlusPlus11)
-      // C++1y features
+      // C++14 features
       .Case("cxx_aggregate_nsdmi", LangOpts.CPlusPlus14)
       .Case("cxx_binary_literals", LangOpts.CPlusPlus14)
       .Case("cxx_contextual_conversions", LangOpts.CPlusPlus14)
@@ -1202,8 +1202,9 @@ static bool HasFeature(const Preprocessor &PP, StringRef Feature) {
       .Case("cxx_relaxed_constexpr", LangOpts.CPlusPlus14)
       .Case("cxx_return_type_deduction", LangOpts.CPlusPlus14)
       .Case("cxx_variable_templates", LangOpts.CPlusPlus14)
-      // C++1z features
-      .Case("cxx_template_auto", LangOpts.CPlusPlus1z)
+      // NOTE: For features covered by SD-6, it is preferable to provide *only*
+      // the SD-6 macro and not a __has_feature check.
+
       // C++ TSes
       //.Case("cxx_runtime_arrays", LangOpts.CPlusPlusTSArrays)
       //.Case("cxx_concepts", LangOpts.CPlusPlusTSConcepts)
@@ -1287,7 +1288,7 @@ static bool HasExtension(const Preprocessor &PP, StringRef Extension) {
            .Case("cxx_reference_qualified_functions", LangOpts.CPlusPlus)
            .Case("cxx_rvalue_references", LangOpts.CPlusPlus)
            .Case("cxx_variadic_templates", LangOpts.CPlusPlus)
-           // C++1y features supported by other languages as extensions.
+           // C++14 features supported by other languages as extensions.
            .Case("cxx_binary_literals", true)
            .Case("cxx_init_captures", LangOpts.CPlusPlus11)
            .Case("cxx_variable_templates", LangOpts.CPlusPlus)
index f7a4ce12985cbf7931dac262069c310f46488dc4..5a4c45ddc1a9771388b1c25bbe5816e037b7704d 100644 (file)
@@ -58,8 +58,7 @@
 
 // static_assert checked below
 
-#if check(template_auto, 0, 0, 0, 0) // FIXME: provisional name
-// FIXME: value shuld be 201606 for cxx1z once implemented
+#if check(template_auto, 0, 0, 0, 201606) // FIXME: provisional name
 #error "wrong value for __cpp_template_auto"
 #endif
 
index eaedc484d8601b8360d0a624cdffd69cb062d4e2..1fe28d5dcbc7af6e35a2b0c55aa943481d11310e 100644 (file)
@@ -689,7 +689,7 @@ as the draft C++1z standard evolves.
     <tr>
       <td>Non-type template parameters with <tt>auto</tt> type</td>
       <td><a href="http://wg21.link/p0127r2">P0127R2</a></td>
-      <td class="none" align="center">No</td>
+      <td class="svn" align="center">SVN</td>
     </tr>
     <tr>
       <td>Guaranteed copy elision</td>