// PR c++/38850 template class Vector2 { private: VType c_[2]; public: typedef Vector2 Self; Vector2(const VType x, const VType y) { c_[0] = x; c_[1] = y; } friend inline Self Max(const Self &v1, const Self &v2) { return Self(v1.c_[0], v1.c_[1]); } }; template Vector2 foo(T x) { Vector2 y(0,0); return Max(y, y); } int main() { foo(3); return 0; }