https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93983
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:f094665d465cdf8903797cc58bea13007e588616 commit r11-541-gf094665d465cdf8903797cc58bea13007e588616 Author: Jonathan Wakely <jwak...@redhat.com> Date: Thu May 21 07:32:15 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. 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.