]> granicus.if.org Git - clang/commitdiff
Mark lambda init-captures as complete.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 28 Sep 2013 04:37:56 +0000 (04:37 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 28 Sep 2013 04:37:56 +0000 (04:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191607 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPMacroExpansion.cpp
test/Lexer/has_extension_cxx.cpp
test/Lexer/has_feature_cxx0x.cpp
www/cxx_status.html

index 2b6f33951b1956d093fa12e5b4c3498173d6da0d..2717846c58b87808961346c3a5e3e86961773248 100644 (file)
@@ -945,7 +945,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
            .Case("cxx_rvalue_references", LangOpts.CPlusPlus11)
            .Case("cxx_strong_enums", LangOpts.CPlusPlus11)
            .Case("cxx_static_assert", LangOpts.CPlusPlus11)
-           .Case("cxx_thread_local", 
+           .Case("cxx_thread_local",
                  LangOpts.CPlusPlus11 && PP.getTargetInfo().isTLSSupported())
            .Case("cxx_trailing_return", LangOpts.CPlusPlus11)
            .Case("cxx_unicode_literals", LangOpts.CPlusPlus11)
@@ -956,11 +956,11 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
            .Case("cxx_aggregate_nsdmi", LangOpts.CPlusPlus1y)
            .Case("cxx_binary_literals", LangOpts.CPlusPlus1y)
            .Case("cxx_contextual_conversions", LangOpts.CPlusPlus1y)
-           //.Case("cxx_generic_lambda", LangOpts.CPlusPlus1y)
-           //.Case("cxx_init_capture", LangOpts.CPlusPlus1y)
+           //.Case("cxx_generic_lambdas", LangOpts.CPlusPlus1y)
+           .Case("cxx_init_captures", LangOpts.CPlusPlus1y)
            .Case("cxx_relaxed_constexpr", LangOpts.CPlusPlus1y)
            .Case("cxx_return_type_deduction", LangOpts.CPlusPlus1y)
-           //.Case("cxx_runtime_array", LangOpts.CPlusPlus1y)
+           //.Case("cxx_runtime_arrays", LangOpts.CPlusPlus1y)
            .Case("cxx_variable_templates", LangOpts.CPlusPlus1y)
            // Type traits
            .Case("has_nothrow_assign", 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_init_captures", LangOpts.CPlusPlus11)
            .Case("cxx_variable_templates", true)
            .Default(false);
 }
index 6646a5ab5817b18a59a554e386cb3ef9321e0677..d3483df94c5aa90c366f4c561298d31802098eb6 100644 (file)
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -E %s -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++98 -E %s -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -E %s -o - | FileCheck %s --check-prefix=CHECK11
 
 // CHECK: c_static_assert
 #if __has_extension(c_static_assert)
@@ -54,3 +55,9 @@ int has_binary_literals();
 #if __has_extension(cxx_variable_templates)
 int has_variable_templates();
 #endif
+
+// CHECK-NOT: has_init_captures
+// CHECK11: has_init_captures
+#if __has_extension(cxx_init_captures)
+int has_init_captures();
+#endif
index 821b5b5f5704496734cce2f6948691564e9f43c9..b2fe842bd6787b8b85c34363695f572c7989730d 100644 (file)
@@ -386,3 +386,13 @@ int no_variable_templates();
 // CHECK-1Y: has_variable_templates
 // CHECK-11: no_variable_templates
 // CHECK-NO-11: no_variable_templates
+
+#if __has_feature(cxx_init_captures)
+int has_init_captures();
+#else
+int no_init_captures();
+#endif
+
+// CHECK-1Y: has_init_captures
+// CHECK-11: no_init_captures
+// CHECK-NO-11: no_init_captures
index d1aa45d88c31b14b27cc063f25561eb803f66614..33430b9129f678ef1e99e109d09d08955b68617e 100644 (file)
@@ -433,15 +433,17 @@ available.</p>
       <td>Return type deduction for normal functions</td>
       <td class="svn" align="center">SVN</td>
     </tr>
+    <!-- Removed from C++1y.
     <tr>
       <td>Runtime-sized arrays with automatic storage duration</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3639.html">N3639</a></td>
       <td class="partial" align="center">Partial</td>
     </tr>
+    -->
     <tr>
       <td>Initialized lambda captures</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3648.html">N3648</a></td>
-      <td class="none" align="center">No</td>
+      <td class="svn" align="center">SVN</td>
     </tr>
     <tr>
       <td>Generic lambdas</td>