r179861 - C++11 support is now feature-complete.

Richard Smith richard-llvm at metafoo.co.uk
Fri Apr 19 12:00:32 CDT 2013


Author: rsmith
Date: Fri Apr 19 12:00:31 2013
New Revision: 179861

URL: http://llvm.org/viewvc/llvm-project?rev=179861&view=rev
Log:
C++11 support is now feature-complete.

Modified:
    cfe/trunk/docs/LanguageExtensions.rst
    cfe/trunk/lib/Lex/PPMacroExpansion.cpp
    cfe/trunk/test/Lexer/has_feature_c1x.c
    cfe/trunk/test/Lexer/has_feature_cxx0x.cpp
    cfe/trunk/www/cxx_status.html
    cfe/trunk/www/index.html

Modified: cfe/trunk/docs/LanguageExtensions.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LanguageExtensions.rst?rev=179861&r1=179860&r2=179861&view=diff
==============================================================================
--- cfe/trunk/docs/LanguageExtensions.rst (original)
+++ cfe/trunk/docs/LanguageExtensions.rst Fri Apr 19 12:00:31 2013
@@ -645,8 +645,7 @@ C++11 inheriting constructors
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Use ``__has_feature(cxx_inheriting_constructors)`` to determine if support for
-inheriting constructors is enabled.  Clang does not currently implement this
-feature.
+inheriting constructors is enabled.
 
 C++11 inline namespaces
 ^^^^^^^^^^^^^^^^^^^^^^^
@@ -727,6 +726,12 @@ Use ``__has_feature(cxx_static_assert)``
 ``__has_extension(cxx_static_assert)`` to determine if support for compile-time
 assertions using ``static_assert`` is enabled.
 
+C++11 ``thread_local``
+^^^^^^^^^^^^^^^^^^^^^^
+
+Use ``__has_feature(cxx_thread_local)`` to determine if support for
+``thread_local`` variables is enabled.
+
 C++11 type inference
 ^^^^^^^^^^^^^^^^^^^^
 
@@ -818,6 +823,12 @@ Use ``__has_feature(c_static_assert)`` o
 to determine if support for compile-time assertions using ``_Static_assert`` is
 enabled.
 
+C11 ``_Thread_local``
+^^^^^^^^^^^^^^^^^^^^^
+
+Use ``__has_feature(c_thread_local)`` to determine if support for
+``_Thread_local`` variables is enabled.
+
 Checks for Type Traits
 ======================
 

Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=179861&r1=179860&r2=179861&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Fri Apr 19 12:00:31 2013
@@ -751,6 +751,7 @@ static bool HasFeature(const Preprocesso
            .Case("c_atomic", LangOpts.C11)
            .Case("c_generic_selections", LangOpts.C11)
            .Case("c_static_assert", LangOpts.C11)
+           .Case("c_thread_local", LangOpts.C11)
            // C++11 features
            .Case("cxx_access_control_sfinae", LangOpts.CPlusPlus11)
            .Case("cxx_alias_templates", LangOpts.CPlusPlus11)
@@ -768,7 +769,7 @@ static bool HasFeature(const Preprocesso
            .Case("cxx_explicit_conversions", LangOpts.CPlusPlus11)
            .Case("cxx_generalized_initializers", LangOpts.CPlusPlus11)
            .Case("cxx_implicit_moves", LangOpts.CPlusPlus11)
-         //.Case("cxx_inheriting_constructors", false)
+           .Case("cxx_inheriting_constructors", LangOpts.CPlusPlus11)
            .Case("cxx_inline_namespaces", LangOpts.CPlusPlus11)
            .Case("cxx_lambdas", LangOpts.CPlusPlus11)
            .Case("cxx_local_type_template_args", LangOpts.CPlusPlus11)
@@ -782,6 +783,7 @@ static bool HasFeature(const Preprocesso
            .Case("cxx_rvalue_references", LangOpts.CPlusPlus11)
            .Case("cxx_strong_enums", LangOpts.CPlusPlus11)
            .Case("cxx_static_assert", LangOpts.CPlusPlus11)
+           .Case("cxx_thread_local", LangOpts.CPlusPlus11)
            .Case("cxx_trailing_return", LangOpts.CPlusPlus11)
            .Case("cxx_unicode_literals", LangOpts.CPlusPlus11)
            .Case("cxx_unrestricted_unions", LangOpts.CPlusPlus11)

Modified: cfe/trunk/test/Lexer/has_feature_c1x.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/has_feature_c1x.c?rev=179861&r1=179860&r2=179861&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/has_feature_c1x.c (original)
+++ cfe/trunk/test/Lexer/has_feature_c1x.c Fri Apr 19 12:00:31 2013
@@ -37,6 +37,15 @@ int no_alignas();
 // CHECK-1X: has_alignas
 // CHECK-NO-1X: no_alignas
 
+#if __has_feature(c_thread_local)
+int has_thread_local();
+#else
+int no_thread_local();
+#endif
+
+// CHECK-1X: has_thread_local
+// CHECK-NO-1X: no_thread_local
+
 #if __STDC_VERSION__ > 199901L
 int is_c1x();
 #else

Modified: cfe/trunk/test/Lexer/has_feature_cxx0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/has_feature_cxx0x.cpp?rev=179861&r1=179860&r2=179861&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/has_feature_cxx0x.cpp (original)
+++ cfe/trunk/test/Lexer/has_feature_cxx0x.cpp Fri Apr 19 12:00:31 2013
@@ -272,3 +272,21 @@ int no_local_type_template_args();
 
 // CHECK-0X: has_local_type_template_args
 // CHECK-NO-0X: no_local_type_template_args
+
+#if __has_feature(cxx_inheriting_constructors)
+int has_inheriting_constructors();
+#else
+int no_inheriting_constructors();
+#endif
+
+// CHECK-0X: has_inheriting_constructors
+// CHECK-NO-0X: no_inheriting_constructors
+
+#if __has_feature(cxx_thread_local)
+int has_thread_local();
+#else
+int no_thread_local();
+#endif
+
+// CHECK-0X: has_thread_local
+// CHECK-NO-0X: no_thread_local

Modified: cfe/trunk/www/cxx_status.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_status.html?rev=179861&r1=179860&r2=179861&view=diff
==============================================================================
--- cfe/trunk/www/cxx_status.html (original)
+++ cfe/trunk/www/cxx_status.html Fri Apr 19 12:00:31 2013
@@ -37,7 +37,10 @@
 
 <h2 id="cxx11">C++11 implementation status</h2>
 
-  <p>Clang provides support for a number of features included in the new <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=50372">ISO C++ Standard, ISO/IEC 14882:2011</a>. The following table describes which C++11 features have been implemented in Clang and in which Clang versions they became available.</p>
+  <p>Clang implements all of the <a
+    href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=50372">ISO
+    C++ 2011 standard</a>. The following table describes the Clang version
+  in which each feature became available.</p>
 
 <p>By default, Clang builds C++ code according to the C++98 standard, with many
 C++11 features accepted as extensions. You can use Clang in C++11 mode with the
@@ -47,7 +50,8 @@ patches are needed to make <a href="libs
 work with Clang in C++11 mode. Patches are also needed to make
 <a href="libstdc++4.6-clang11.patch">libstdc++-4.6</a>,
 and <a href="libstdc++4.7-clang11.patch">libstdc++-4.7</a> work with Clang
-releases prior to version 3.2 in C++11 mode.</p>
+releases prior to version 3.2 in C++11 mode. <tt>thread_local</tt> support
+currently requires g++-4.8's C++ runtime library.</p>
 
 <table width="689" border="1" cellspacing="0">
  <tr>
@@ -349,7 +353,7 @@ releases prior to version 3.2 in C++11 m
     <tr>
       <td>Thread-local storage</td>
       <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm">N2659</a></td>
-      <td class="none" align="center">No</td>
+      <td class="svn" align="center">SVN</td>
     </tr>
     <tr>
       <td>Dynamic initialization and destruction with concurrency</td>

Modified: cfe/trunk/www/index.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/index.html?rev=179861&r1=179860&r2=179861&view=diff
==============================================================================
--- cfe/trunk/www/index.html (original)
+++ cfe/trunk/www/index.html Fri Apr 19 12:00:31 2013
@@ -94,7 +94,7 @@
    targeting X86-32, X86-64, and ARM (other targets may have caveats, but are 
    usually easy to fix).  If you are looking for source analysis or
    source-to-source transformation tools, clang is probably a great
-   solution for you.  Clang supports most of C++11, please see the <a
+   solution for you.  Clang supports C++11, please see the <a
     href="cxx_status.html">C++ status</a> page for more
    information.</p>
 




More information about the cfe-commits mailing list