cplusplus / CWG

Core Working Group
23 stars 7 forks source link

[cpp.predefined] P2280R4 failed to introduce a feature test macro change #480

Closed Mick235711 closed 9 months ago

Mick235711 commented 9 months ago

Full name of submitter (unless configured in github; will be published with the issue): Yihe Li

Reference (section label): [cpp.predefined]

Link to reflector thread (if any): N/A

Issue description:

Apologize if this have been discussed. P2280R4 was adopted in the 2022-07 plenary for C++23. However, the paper failed to include a feature test macro change, when one seems to be desirable due to the visible change to the validity of std::size mentioned in the paper.

Suggested resolution:

Ideally, bump __cpp_constexpr would be desirable. The macro already have a valid value of 202207L for P2448R2. Therefore it seems that modifying the standard is not necessary, and only SD-6 need to be modified to add an entry under that value.

frederick-vs-ja commented 9 months ago

Ideally, bump __cpp_constexpr would be desirable.

I believe we shouldn't bump it for P2280R4. P2280R4 was accepted as a DR, and thus implementations are recommended to backport it, even to the C++11 modes. IIUC there're certainly C++11-era constexpr things that can be meaningfully affected by P2280R4. It's definitely undesired to have __cpp_constexpr bumped to the same large value in C++11/14/17/20 modes.

I suggest to add a new macro __cpp_constexpr_reference_parameter with value 202207L, if wanted. However, I guess it was intended not to add a feature-test macro for the changes in P2280R4.

jensmaurer commented 9 months ago

P2280R4 was accepted as a DR

Indeed, thus this is considered a bug fix, not a feature. No feature, no feature-test macro.