[PATCH] D149553: [clang] Use -std=c++23 instead of -std=c++2b

Mark de Wever via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 3 09:26:56 PDT 2023


Mordante marked 3 inline comments as done.
Mordante added a comment.

In D149553#4313211 <https://reviews.llvm.org/D149553#4313211>, @aaron.ballman wrote:

> In D149553#4312788 <https://reviews.llvm.org/D149553#4312788>, @Mordante wrote:
>
>> In D149553#4310478 <https://reviews.llvm.org/D149553#4310478>, @aaron.ballman wrote:
>>
>>> Thank you for working on this! The Clang changes are mostly all good, but I think we should hold off on changing the value of `__cplusplus` for the moment as it's not set in stone in the standard yet (I thought it was though, so I'm checking with the editor).
>>
>> I noticed the same and I was wondering whether I should contact the editor. I noticed some approved papers also have not been merged yet. (These papers are still open issues in the paper repository.)
>>
>> I'll wait a few days to see whether the draft gets updated otherwise I revert the macro change.
>>
>> I would be very surprised if the macro gets a different value, that's why I already bumped it.
>
> I heard back from the editor yesterday and he said that the macro would be replaced with an appropriate value for the DIS, and that he hopes to ensure that value is published in the next meeting mailing (which would be roughly May 15). So I think we can either wait until that mailing comes out and see if it has a concrete value to land these changes, or we can land everything but the macro value changes and deal with that in a follow up (this might be easier due to rebasing woes given how large this patch is).

Yes I created a new patch for that part. That patch is a lot easier to rebase than this one.



================
Comment at: clang/lib/Frontend/InitPreprocessor.cpp:455
+    if (LangOpts.CPlusPlus23)
+      Builder.defineMacro("__cplusplus", "202302L");
     //      [C++20] The integer literal 202002L.
----------------
aaron.ballman wrote:
> I think this might still be premature. I noticed that the draft C++ standard does not have this value set yet: https://github.com/cplusplus/draft/blob/main/source/config.tex#L6
> 
> I've emailed the editor to find out if that's a mistake (I am pretty sure we're sending this off to PDTS at some point shortly).
I've reverted this and similar parts. They are now in D149761. I will update that patch once editor made a release with the updated `__cplusplus` macro.


================
Comment at: clang/test/Parser/cxx2b-label.cpp:1
-// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx2b -std=c++2b -Wpre-c++2b-compat %s
+// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx23 -std=c++23 -Wpre-c++23-compat %s
 // RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx20 -std=c++20 %s
----------------
ldionne wrote:
> We could also consider renaming those files.
I could do that but rather in a follow-up there are still files named like `clang/test/Parser/cxx0x-lambda-expressions.cpp` too. I'm not sure how much the Clang devs want to remove these code names.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149553



More information about the cfe-commits mailing list