https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117187
Bug ID: 117187 Summary: __niter_base overloads need to be declare before use Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- This fails to compile: #include <iterator> #include <algorithm> #include <vector> struct S { }; int main() { std::vector<S> v; std::vector<S> out; std::copy(v.begin(), v.end(), std::make_move_iterator(vout.begin())); } The problem is that the __niter_wrap function calls std::__niter_base on the move_iterator but the __niter_base(move_iterator<I>) overload has not been declared at that point.