https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104928

--- Comment #10 from Benjamin Buch <benni.buch at gmail dot com> ---
Okay, I understand this.

https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2020

defines P1135R6 is implemented since libstdc++ 11.1 and the feature test macro
__cpp_lib_semaphore >= 201907L is defined accordingly while the implementation
is known to produce wrong code for nearly 2 years and three major releases now.
It brings us into a situation again, where users have to detect compiler and
compiler version to check whether they can use std::counting_semaphore instead
of just checking the feature test macro.

In my option this is a very bad and hard to acceptable situation, even in an
experimental mode. Especially since C++20 already has a wide adoption these
days.

So I ask you to undefine the feature test macro and set the implementation
state to partial.

Also I propose to introduce -std=c++XXpreview flags for all (new) experimental
language modes instead of -std=c++XX which misleadingly indicates that the mode
is ready to use. The documentation might name the modes as experimental, but I
think its much more user-friendly to make the flag itself expressive.

(MSVC also starts doing this with the upcoming release 2022 17.13 for C++23.
There will be a c++23preview mode.)

I understand that this might break existing code. Nevertheless in my opinion
its better to loudly fail at compile time that silently doing the wrong thing
at runtime. We all know that software contains bug. That's normal. To actively
inform the users is important and user-friendly. Sometimes even more important
than fixing the bug itself. ;-)

Reply via email to