[PATCH] D120456: bump __cpp_concepts and __cpp_constexpr in accordance with P2493R0

2022-02-24 Thread Marcus Boay via Phabricator via cfe-commits
MarcusBoay created this revision.
MarcusBoay requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120456

Files:
  clang/lib/Frontend/InitPreprocessor.cpp
  clang/test/Lexer/cxx-features.cpp


Index: clang/test/Lexer/cxx-features.cpp
===
--- clang/test/Lexer/cxx-features.cpp
+++ clang/test/Lexer/cxx-features.cpp
@@ -52,7 +52,7 @@
 #error "wrong value for __cpp_char8_t"
 #endif
 
-#if check(concepts, 0, 0, 0, 0, 201907, 201907)
+#if check(concepts, 0, 0, 0, 0, 202002L, 202002L)
 #error "wrong value for __cpp_concepts"
 #endif
 
@@ -277,7 +277,7 @@
 #error "wrong value for __cpp_lambdas"
 #endif
 
-#if check(constexpr, 0, 200704, 201304, 201603, 201907, 201907)
+#if check(constexpr, 0, 200704, 201304, 201603, 202110L, 202110L)
 #error "wrong value for __cpp_constexpr"
 #endif
 
Index: clang/lib/Frontend/InitPreprocessor.cpp
===
--- clang/lib/Frontend/InitPreprocessor.cpp
+++ clang/lib/Frontend/InitPreprocessor.cpp
@@ -562,7 +562,7 @@
 Builder.defineMacro("__cpp_user_defined_literals", "200809L");
 Builder.defineMacro("__cpp_lambdas", "200907L");
 Builder.defineMacro("__cpp_constexpr",
-LangOpts.CPlusPlus20 ? "201907L" :
+LangOpts.CPlusPlus20 ? "202110L" :
 LangOpts.CPlusPlus17 ? "201603L" :
 LangOpts.CPlusPlus14 ? "201304L" : "200704");
 Builder.defineMacro("__cpp_constexpr_in_decltype", "201711L");
@@ -629,7 +629,7 @@
   // C++20 features.
   if (LangOpts.CPlusPlus20) {
 //Builder.defineMacro("__cpp_aggregate_paren_init", "201902L");
-Builder.defineMacro("__cpp_concepts", "201907L");
+Builder.defineMacro("__cpp_concepts", "202002L");
 Builder.defineMacro("__cpp_conditional_explicit", "201806L");
 //Builder.defineMacro("__cpp_consteval", "201811L");
 Builder.defineMacro("__cpp_constexpr_dynamic_alloc", "201907L");


Index: clang/test/Lexer/cxx-features.cpp
===
--- clang/test/Lexer/cxx-features.cpp
+++ clang/test/Lexer/cxx-features.cpp
@@ -52,7 +52,7 @@
 #error "wrong value for __cpp_char8_t"
 #endif
 
-#if check(concepts, 0, 0, 0, 0, 201907, 201907)
+#if check(concepts, 0, 0, 0, 0, 202002L, 202002L)
 #error "wrong value for __cpp_concepts"
 #endif
 
@@ -277,7 +277,7 @@
 #error "wrong value for __cpp_lambdas"
 #endif
 
-#if check(constexpr, 0, 200704, 201304, 201603, 201907, 201907)
+#if check(constexpr, 0, 200704, 201304, 201603, 202110L, 202110L)
 #error "wrong value for __cpp_constexpr"
 #endif
 
Index: clang/lib/Frontend/InitPreprocessor.cpp
===
--- clang/lib/Frontend/InitPreprocessor.cpp
+++ clang/lib/Frontend/InitPreprocessor.cpp
@@ -562,7 +562,7 @@
 Builder.defineMacro("__cpp_user_defined_literals", "200809L");
 Builder.defineMacro("__cpp_lambdas", "200907L");
 Builder.defineMacro("__cpp_constexpr",
-LangOpts.CPlusPlus20 ? "201907L" :
+LangOpts.CPlusPlus20 ? "202110L" :
 LangOpts.CPlusPlus17 ? "201603L" :
 LangOpts.CPlusPlus14 ? "201304L" : "200704");
 Builder.defineMacro("__cpp_constexpr_in_decltype", "201711L");
@@ -629,7 +629,7 @@
   // C++20 features.
   if (LangOpts.CPlusPlus20) {
 //Builder.defineMacro("__cpp_aggregate_paren_init", "201902L");
-Builder.defineMacro("__cpp_concepts", "201907L");
+Builder.defineMacro("__cpp_concepts", "202002L");
 Builder.defineMacro("__cpp_conditional_explicit", "201806L");
 //Builder.defineMacro("__cpp_consteval", "201811L");
 Builder.defineMacro("__cpp_constexpr_dynamic_alloc", "201907L");
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D120456: [clang] Bump __cpp_concepts and __cpp_constexpr in accordance with P2493R0

2022-02-24 Thread Marcus Boay via Phabricator via cfe-commits
MarcusBoay updated this revision to Diff 411293.
MarcusBoay added a comment.

Revert __cpp_concepts since it is not fully implemented yet.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120456/new/

https://reviews.llvm.org/D120456

Files:
  clang/lib/Frontend/InitPreprocessor.cpp
  clang/test/Lexer/cxx-features.cpp


Index: clang/test/Lexer/cxx-features.cpp
===
--- clang/test/Lexer/cxx-features.cpp
+++ clang/test/Lexer/cxx-features.cpp
@@ -277,7 +277,7 @@
 #error "wrong value for __cpp_lambdas"
 #endif
 
-#if check(constexpr, 0, 200704, 201304, 201603, 201907, 201907)
+#if check(constexpr, 0, 200704, 201304, 201603, 202110L, 202110L)
 #error "wrong value for __cpp_constexpr"
 #endif
 
Index: clang/lib/Frontend/InitPreprocessor.cpp
===
--- clang/lib/Frontend/InitPreprocessor.cpp
+++ clang/lib/Frontend/InitPreprocessor.cpp
@@ -561,10 +561,13 @@
 Builder.defineMacro("__cpp_unicode_literals", "200710L");
 Builder.defineMacro("__cpp_user_defined_literals", "200809L");
 Builder.defineMacro("__cpp_lambdas", "200907L");
-Builder.defineMacro("__cpp_constexpr",
-LangOpts.CPlusPlus20 ? "201907L" :
-LangOpts.CPlusPlus17 ? "201603L" :
-LangOpts.CPlusPlus14 ? "201304L" : "200704");
+Builder.defineMacro("__cpp_constexpr", LangOpts.CPlusPlus20
+   ? "202110L"
+   : LangOpts.CPlusPlus17
+ ? "201603L"
+ : LangOpts.CPlusPlus14
+   ? "201304L"
+   : "200704");
 Builder.defineMacro("__cpp_constexpr_in_decltype", "201711L");
 Builder.defineMacro("__cpp_range_based_for",
 LangOpts.CPlusPlus17 ? "201603L" : "200907");


Index: clang/test/Lexer/cxx-features.cpp
===
--- clang/test/Lexer/cxx-features.cpp
+++ clang/test/Lexer/cxx-features.cpp
@@ -277,7 +277,7 @@
 #error "wrong value for __cpp_lambdas"
 #endif
 
-#if check(constexpr, 0, 200704, 201304, 201603, 201907, 201907)
+#if check(constexpr, 0, 200704, 201304, 201603, 202110L, 202110L)
 #error "wrong value for __cpp_constexpr"
 #endif
 
Index: clang/lib/Frontend/InitPreprocessor.cpp
===
--- clang/lib/Frontend/InitPreprocessor.cpp
+++ clang/lib/Frontend/InitPreprocessor.cpp
@@ -561,10 +561,13 @@
 Builder.defineMacro("__cpp_unicode_literals", "200710L");
 Builder.defineMacro("__cpp_user_defined_literals", "200809L");
 Builder.defineMacro("__cpp_lambdas", "200907L");
-Builder.defineMacro("__cpp_constexpr",
-LangOpts.CPlusPlus20 ? "201907L" :
-LangOpts.CPlusPlus17 ? "201603L" :
-LangOpts.CPlusPlus14 ? "201304L" : "200704");
+Builder.defineMacro("__cpp_constexpr", LangOpts.CPlusPlus20
+   ? "202110L"
+   : LangOpts.CPlusPlus17
+ ? "201603L"
+ : LangOpts.CPlusPlus14
+   ? "201304L"
+   : "200704");
 Builder.defineMacro("__cpp_constexpr_in_decltype", "201711L");
 Builder.defineMacro("__cpp_range_based_for",
 LangOpts.CPlusPlus17 ? "201603L" : "200907");
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D120456: [clang] Bump __cpp_constexpr in accordance with P2493R0

2022-02-24 Thread Marcus Boay via Phabricator via cfe-commits
MarcusBoay added a comment.

In D120456#3343348 , @cor3ntin wrote:

> Thanks for the patch. However,  wg21.link/P0848 need to be fully implemented 
> before we can update `__cpp_concepts`. Could you only modify 
> `__cpp_constexpr` ? Thanks

Thanks for the info! I reverted the change to `__cpp_concepts`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120456/new/

https://reviews.llvm.org/D120456

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits