// PR c++/89537 // { dg-do compile { target c++11 } } template class A {}; template class B; class C { using mapped_type = int; public: template C(B, A> *p1, unsigned) : keys(p1->keys), // { dg-error "18: invalid use of non-static member function" } values(p1->values) {} // { dg-error "20: invalid use of non-static member function" } A keys; A values; }; class D { public: using key_compare = int; template D(key_compare, _Alloc); }; template > class B { using _Impl = D; _Impl _M_impl; public: using key_compare = int; using iterator = C; template B(key_compare p1, _Alloc p2) : _M_impl(p1, p2) {} template B(_Alloc p1) : B(key_compare(), p1) {} iterator begin() { return {this, 0}; } void keys(); void values(); }; void fn1() { B> m(fn1); m.begin(); }