https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115767
--- Comment #19 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So far in my reduced testcase: This fails: auto find() { return this->template functor<typename base_::iterator_from_base>()( this->base().find(0)); } While this works: auto find() { return this->base().find(0); } Which is why I said there seems to be some aliasing issue with iterators.