// PR c++/69315 // { dg-do compile { target c++11 } } // { dg-options "-O2" } // Template instantiation and evaluation for folding within // finish_function may call finish_function recursively. // Make sure we don't reject or delay that sort of recursion. template struct Iter; struct Arg { Iter begin(); Iter end(); }; template struct Iter { int operator*(); Iter operator++(); template friend constexpr bool operator==(Iter, Iter); template friend constexpr bool operator!=(Iter, Iter); }; void func(Arg a) { for (auto ch : a) { a.begin() == a.end(); } } template constexpr bool operator==(Iter, Iter) { return true; } template constexpr bool operator!=(Iter a, Iter b) { return a == b; }