r295791 - [c++1z] Mark constexpr lambdas as done on status page and start advertising
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 21 15:58:30 PST 2017
Author: rsmith
Date: Tue Feb 21 17:58:29 2017
New Revision: 295791
URL: http://llvm.org/viewvc/llvm-project?rev=295791&view=rev
Log:
[c++1z] Mark constexpr lambdas as done on status page and start advertising
them via feature test macro __cpp_constexpr.
Thanks to Faisal for implementing this feature!
Modified:
cfe/trunk/lib/Frontend/InitPreprocessor.cpp
cfe/trunk/test/Lexer/cxx-features.cpp
cfe/trunk/www/cxx_status.html
Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=295791&r1=295790&r2=295791&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Tue Feb 21 17:58:29 2017
@@ -475,6 +475,7 @@ static void InitializeCPlusPlusFeatureTe
Builder.defineMacro("__cpp_user_defined_literals", "200809");
Builder.defineMacro("__cpp_lambdas", "200907");
Builder.defineMacro("__cpp_constexpr",
+ LangOpts.CPlusPlus1z ? "201603" :
LangOpts.CPlusPlus14 ? "201304" : "200704");
Builder.defineMacro("__cpp_range_based_for",
LangOpts.CPlusPlus1z ? "201603" : "200907");
Modified: cfe/trunk/test/Lexer/cxx-features.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/cxx-features.cpp?rev=295791&r1=295790&r2=295791&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/cxx-features.cpp (original)
+++ cfe/trunk/test/Lexer/cxx-features.cpp Tue Feb 21 17:58:29 2017
@@ -50,7 +50,7 @@
#error "wrong value for __cpp_capture_star_this"
#endif
-// FIXME: bump __cpp_constexpr to 201603 for constexpr lambda support
+// constexpr checked below
#if check(if_constexpr, 0, 0, 0, 201606) // FIXME: provisional name
#error "wrong value for __cpp_if_constexpr"
@@ -167,7 +167,7 @@
#error "wrong value for __cpp_lambdas"
#endif
-#if check(constexpr, 0, 200704, 201304, 201304)
+#if check(constexpr, 0, 200704, 201304, 201603)
#error "wrong value for __cpp_constexpr"
#endif
Modified: cfe/trunk/www/cxx_status.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/cxx_status.html?rev=295791&r1=295790&r2=295791&view=diff
==============================================================================
--- cfe/trunk/www/cxx_status.html (original)
+++ cfe/trunk/www/cxx_status.html Tue Feb 21 17:58:29 2017
@@ -648,7 +648,7 @@ as the draft C++1z standard evolves.
<tr>
<td><tt>constexpr</tt> lambda expressions</td>
<td><a href="http://wg21.link/p0170r1">P0170R1</a></td>
- <td class="none" align="center">No</td>
+ <td class="svn" align="center">SVN</td>
</tr>
<tr>
<td>Differing <tt>begin</tt> and <tt>end</tt> types in range-based <tt>for</tt></td>
More information about the cfe-commits
mailing list