// PR c++/89652 // { dg-do compile { target c++14 } } // { dg-options "" } template constexpr auto foo (T &e) { return e.foo (); } template constexpr auto bar (T &e) { return foo (e); } template struct A { typedef T a[N]; }; template struct B { typedef T *b; typename A::a d; constexpr b foo () { return d; } }; template struct C { long m; }; struct D { long n; }; template struct E { B, 1>::b p; constexpr D operator* () { return {p->m}; } constexpr E operator++ (int) { auto a{*this}; ++p; return a; } }; template constexpr bool operator!= (E a, E) { return a.p; } template constexpr auto baz (B s, B) { B t{}; auto q{foo (t)}; using u = E; auto v = u{bar (s)}; auto w = u{}; while (v != w) *q++ = *v++; return t; } constexpr auto a = B, 5>{}; auto b = B{}; auto c = baz (a, b);