// { dg-do assemble } // Origin: Neil Booth, from bug report #36 template class vect; template vect operator-( const vect&, const vect& ); template class vect { public: vect( t a ); vect( const vect& v ); ~vect(); vect& operator=( const vect& v ); vect operator-( void ) const; friend vect (::operator- <>)( const vect&, const vect& ); private: t a_; }; template inline vect::vect( t a ) : a_(a) { } template inline vect::vect( const vect& v ) : a_(v.a_) { } template inline vect::~vect() { } template inline vect& vect::operator=( const vect& v ) { a_ = v.a_; return *this; } template inline vect vect::operator-( void ) const { return vect( -a_ ); } template inline vect operator-( const vect& u, const vect& v ) { return vect( u.a_ - v.a_ ); } int main( void ) { vect a( 1.0 ), b( 0.0 ); b = -a; }