[Bug libstdc++/104098] [11/12 Regression] bits/stl_iterator.h fails to compile for __cplusplus > 201703L and with __cpp_concepts undefined

2022-01-18 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104098

--- Comment #5 from Jonathan Wakely  ---
Fixed for trunk, backport to follow.

[Bug libstdc++/104098] [11/12 Regression] bits/stl_iterator.h fails to compile for __cplusplus > 201703L and with __cpp_concepts undefined

2022-01-18 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104098

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/g:e13e95bd274148a825bc9527efac49e99080dd64

commit r12-6692-ge13e95bd274148a825bc9527efac49e99080dd64
Author: Jonathan Wakely 
Date:   Tue Jan 18 15:34:24 2022 +

libstdc++: Use __cpp_lib_concepts in std::reverse_iterator [PR104098]

We should not assume that std::iter_value_t etc. are defined
unconditionally for C++20 mode.

libstdc++-v3/ChangeLog:

PR libstdc++/104098
* include/bits/stl_iterator.h (reverse_iterator): Check
__cpp_lib_concepts instead of __cplusplus.

[Bug libstdc++/104098] [11/12 Regression] bits/stl_iterator.h fails to compile for __cplusplus > 201703L and with __cpp_concepts undefined

2022-01-18 Thread richard.corden at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104098

--- Comment #3 from Richard Corden  ---
(In reply to Jonathan Wakely from comment #1)
> Is this an issue for a non-GCC tool with incomplete C++20 support?
> 

It is yes.

Thanks for the quick reply.

[Bug libstdc++/104098] [11/12 Regression] bits/stl_iterator.h fails to compile for __cplusplus > 201703L and with __cpp_concepts undefined

2022-01-18 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104098

Jonathan Wakely  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org

--- Comment #2 from Jonathan Wakely  ---
I think we should just change it to check __cpp_lib_concepts, which is only
true for C++20 anyway:

-#if __cplusplus <= 201703L
+#if ! __cpp_lib_concepts


That is the right condition for using __clamp_iter_cat, iter_value_t,
iter_difference_t and iter_reference_t.

[Bug libstdc++/104098] [11/12 Regression] bits/stl_iterator.h fails to compile for __cplusplus > 201703L and with __cpp_concepts undefined

2022-01-18 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104098

Jonathan Wakely  changed:

   What|Removed |Added

   Target Milestone|--- |11.3
 Ever confirmed|0   |1
  Known to work||11.1.0
   Last reconfirmed||2022-01-18
Summary|bits/stl_iterator.h fails   |[11/12 Regression]
   |to compile for __cplusplus  |bits/stl_iterator.h fails
   |> 201703L and with  |to compile for __cplusplus
   |__cpp_concepts undefined|> 201703L and with
   ||__cpp_concepts undefined
  Known to fail||11.2.0, 12.0
 Status|UNCONFIRMED |NEW

--- Comment #1 from Jonathan Wakely  ---
Is this an issue for a non-GCC tool with incomplete C++20 support?

The relevant commits are r12-946 on trunk and the r11-8540 backport.