From 31ea0cb0991891ccd35f1b18fe3a225b3e284f2b Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 21 Feb 2017 23:58:29 +0000 Subject: [PATCH] [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! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295791 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/InitPreprocessor.cpp | 1 + test/Lexer/cxx-features.cpp | 4 ++-- www/cxx_status.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index 11d58ed2eb..1acfe708ee 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -475,6 +475,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, 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"); diff --git a/test/Lexer/cxx-features.cpp b/test/Lexer/cxx-features.cpp index 359deedbee..d69ef08a59 100644 --- a/test/Lexer/cxx-features.cpp +++ b/test/Lexer/cxx-features.cpp @@ -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 diff --git a/www/cxx_status.html b/www/cxx_status.html index 6cb87a8bc2..736a08597d 100644 --- a/www/cxx_status.html +++ b/www/cxx_status.html @@ -648,7 +648,7 @@ as the draft C++1z standard evolves. constexpr lambda expressions P0170R1 - No + SVN Differing begin and end types in range-based for -- 2.40.0