public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/97935] New: Missing subsumption in iterator category detection
@ 2020-11-21 23:09 rs2740 at gmail dot com
  2020-11-22  0:46 ` [Bug libstdc++/97935] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rs2740 at gmail dot com @ 2020-11-21 23:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97935
           Summary: Missing subsumption in iterator category detection
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rs2740 at gmail dot com
  Target Milestone: ---

In <bits/iterator_concepts.h>:

      template<typename _Iter>
        requires (!requires { typename _Iter::iterator_category; }
                  && __detail::__cpp17_randacc_iterator<_Iter>)
        struct __cat<_Iter>
        { using type = random_access_iterator_tag; };

      template<typename _Iter>
        requires (!requires { typename _Iter::iterator_category; }
                  && __detail::__cpp17_bidi_iterator<_Iter>)
        struct __cat<_Iter>
        { using type = bidirectional_iterator_tag; };

      template<typename _Iter>
        requires (!requires { typename _Iter::iterator_category; }
                  && __detail::__cpp17_fwd_iterator<_Iter>)
        struct __cat<_Iter>
        { using type = forward_iterator_tag; };

The !requires part of the constraints do not subsume each other, so any
iterator that is a __cpp17_bidi_iterator or stronger causes an ambiguity. It
needs to be extracted into a concept.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-25 18:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-21 23:09 [Bug libstdc++/97935] New: Missing subsumption in iterator category detection rs2740 at gmail dot com
2020-11-22  0:46 ` [Bug libstdc++/97935] " redi at gcc dot gnu.org
2020-11-25 17:41 ` cvs-commit at gcc dot gnu.org
2020-11-25 18:11 ` cvs-commit at gcc dot gnu.org
2020-11-25 18:11 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).