https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107471
Bug ID: 107471 Summary: mismatching constraints in common_iterator Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: h2+bugs at fsfe dot org Target Milestone: --- In bits/stl_iterator.h: ```cpp /// An iterator/sentinel adaptor for representing a non-common range. template<input_or_output_iterator _It, sentinel_for<_It> _Sent> requires (!same_as<_It, _Sent>) && copyable<_It> class common_iterator { // ... template<input_or_output_iterator _It2, sentinel_for<_It2> _Sent2> friend class common_iterator; ``` The constraints are mismatching. GCC (falsely) accepts this, but clang fails, see also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107470