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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jonathan Wakely
<r...@gcc.gnu.org>:

https://gcc.gnu.org/g:566ba72126288272607374a32ac646dcd36fe584

commit r10-8163-g566ba72126288272607374a32ac646dcd36fe584
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Thu May 21 07:47:17 2020 +0100

    libstdc++: Avoid constraint recursion with iterator_traits (PR 93983)

    Checking whether a filesystem::path constructor argument is an iterator
    requires instantiating std::iterator_traits. In C++20 that checks for
    satisfaction of std::iterator_traits constraints, which checks if the
    type is copyable, which can end up recursing back to the path
    constructor. The fix in LWG 3420 is to reorder the cpp17-iterator
    concept's constraints to check if the type looks vaguely like an
    iterator before checking copyable. That avoids the recursion for types
    which definitely aren't iterators, but isn't foolproof.

    Backport from mainline
    2020-05-21  Jonathan Wakely  <jwak...@redhat.com>

            PR libstdc++/93983
            * include/bits/iterator_concepts.h (__detail::__cpp17_iterator):
            Reorder constraints to avoid recursion when constructors use
            iterator_traits (LWG 3420).
            * testsuite/24_iterators/customization_points/lwg3420.cc: New test.

Reply via email to