[llvm-branch-commits] [cfe-branch] r195899 - Merging r195888:

Bill Wendling isanbard at gmail.com
Wed Nov 27 16:33:43 PST 2013


Author: void
Date: Wed Nov 27 18:33:42 2013
New Revision: 195899

URL: http://llvm.org/viewvc/llvm-project?rev=195899&view=rev
Log:
Merging r195888:
------------------------------------------------------------------------
r195888 | rsmith | 2013-11-27 14:58:16 -0800 (Wed, 27 Nov 2013) | 2 lines

Add support for C++'s SD6 feature test macros.

------------------------------------------------------------------------

Added:
    cfe/branches/release_34/test/Lexer/cxx-features.cpp
      - copied unchanged from r195888, cfe/trunk/test/Lexer/cxx-features.cpp
Modified:
    cfe/branches/release_34/   (props changed)
    cfe/branches/release_34/lib/Frontend/InitPreprocessor.cpp
    cfe/branches/release_34/www/cxx_status.html

Propchange: cfe/branches/release_34/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov 27 18:33:42 2013
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:195126,195128,195135-195136,195146,195149,195154,195158,195163,195168,195174,195268,195283,195303,195326,195329,195367,195384,195409,195420,195422,195501,195547,195556,195558,195587,195620,195669,195687,195693,195710,195716,195760,195768
+/cfe/trunk:195126,195128,195135-195136,195146,195149,195154,195158,195163,195168,195174,195268,195283,195303,195326,195329,195367,195384,195409,195420,195422,195501,195547,195556,195558,195587,195620,195669,195687,195693,195710,195716,195760,195768,195888
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_34/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/lib/Frontend/InitPreprocessor.cpp?rev=195899&r1=195898&r2=195899&view=diff
==============================================================================
--- cfe/branches/release_34/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/branches/release_34/lib/Frontend/InitPreprocessor.cpp Wed Nov 27 18:33:42 2013
@@ -346,6 +346,38 @@ static void InitializeStandardPredefined
     Builder.defineMacro("__ASSEMBLER__");
 }
 
+/// Initialize the predefined C++ language feature test macros defined in
+/// ISO/IEC JTC1/SC22/WG21 (C++) SD-6: "SG10 Feature Test Recommendations".
+static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
+                                                 MacroBuilder &Builder) {
+  // C++11 features.
+  if (LangOpts.CPlusPlus11) {
+    Builder.defineMacro("__cpp_unicode_characters", "200704");
+    Builder.defineMacro("__cpp_raw_strings", "200710");
+    Builder.defineMacro("__cpp_unicode_literals", "200710");
+    Builder.defineMacro("__cpp_user_defined_literals", "200809");
+    Builder.defineMacro("__cpp_lambdas", "200907");
+    Builder.defineMacro("__cpp_constexpr",
+                        LangOpts.CPlusPlus1y ? "201304" : "200704");
+    Builder.defineMacro("__cpp_static_assert", "200410");
+    Builder.defineMacro("__cpp_decltype", "200707");
+    Builder.defineMacro("__cpp_attributes", "200809");
+    Builder.defineMacro("__cpp_rvalue_references", "200610");
+    Builder.defineMacro("__cpp_variadic_templates", "200704");
+  }
+
+  // C++14 features.
+  if (LangOpts.CPlusPlus1y) {
+    Builder.defineMacro("__cpp_binary_literals", "201304");
+    Builder.defineMacro("__cpp_init_captures", "201304");
+    Builder.defineMacro("__cpp_generic_lambdas", "201304");
+    Builder.defineMacro("__cpp_decltype_auto", "201304");
+    Builder.defineMacro("__cpp_return_type_deduction", "201304");
+    Builder.defineMacro("__cpp_aggregate_nsdmi", "201304");
+    Builder.defineMacro("__cpp_variable_templates", "201304");
+  }
+}
+
 static void InitializePredefinedMacros(const TargetInfo &TI,
                                        const LangOptions &LangOpts,
                                        const FrontendOptions &FEOpts,
@@ -438,6 +470,9 @@ static void InitializePredefinedMacros(c
     Builder.defineMacro("IBAction", "void)__attribute__((ibaction)");
   }
 
+  if (LangOpts.CPlusPlus)
+    InitializeCPlusPlusFeatureTestMacros(LangOpts, Builder);
+
   // darwin_constant_cfstrings controls this. This is also dependent
   // on other things like the runtime I believe.  This is set even for C code.
   if (!LangOpts.NoConstantCFStrings)

Modified: cfe/branches/release_34/www/cxx_status.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/www/cxx_status.html?rev=195899&r1=195898&r2=195899&view=diff
==============================================================================
--- cfe/branches/release_34/www/cxx_status.html (original)
+++ cfe/branches/release_34/www/cxx_status.html Wed Nov 27 18:33:42 2013
@@ -491,6 +491,31 @@ available.</p>
 <p>You can use Clang in C++1z mode with the <code>-std=c++1z</code> option.</p>
 -->
 
+<h2 id="ts">Technical specifications and standing documents</h2>
+
+<p>ISO C++ also publishes a number of documents describing additional language
+and library features that are not part of standard C++. The following table
+describes which language features have been implemented in Clang and in which
+Clang version they became available:</p>
+
+<table width="689" border="1" cellspacing="0">
+ <tr>
+    <th>Document</th>
+    <th>Latest draft</th>
+    <th>Available in Clang?</th>
+ </tr>
+    <tr>
+      <td>SD-6: SG10 feature test recommendations</td>
+      <td><a href="http://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations">SD-6</a></td>
+      <td class="svn" align="center">SVN (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3745">N3745</a>)</td>
+    </tr>
+    <tr>
+      <td>[DRAFT TS] Array extensions (arrays of runtime bound)</td>
+      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3820.html">N3820</a></td>
+      <td class="none" align="center">No</td>
+    </tr>
+</table>
+
 </div>
 </body>
 </html>





More information about the llvm-branch-commits mailing list