// { dg-do compile } // { dg-additional-options "-std=c++11" } namespace std { typedef long unsigned size_t; template class complex; template complex<_Tp> operator+(complex<_Tp>, complex<_Tp>) { complex<_Tp> a = 0; a += 0; return a; } template <> struct complex { complex (int __i) : _M_value{ __i } {} int imag (); void operator+=(complex __z) { _M_value = __z.imag (); } _Complex double _M_value; }; } class A { public: A (int); std::complex &operator[](int i) { return data_[i]; } std::complex *data_; }; struct B { static std::complex apply (std::complex t1, std::complex t2) { return t1 + t2; } }; template struct C { static void apply (T1 t1, std::complex t2) { t1 = t2; } }; template class D { public: E operator()(); }; class G : public D { public: typedef std::complex value_type; value_type operator()(int) { return B::apply (0, 0); } }; template G operator+(D, D); template