2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / template / unify1.C
blob2f0a18cf4574e083d08295c033ded217aed27e39
1 // Test non-type template argument folding.
2 // Origin: smacdonald@seimac.com
4 // { dg-do compile }
6 template < int I1, int I2 >
7 class unit
9 public:
10   unit() {}
11   unit( const unit<I1,I2>& ) {}
13   template< int Q1, int Q2 >
14   unit< I1 - Q1, I2 - Q2 > operator / ( const unit< Q1, Q2 >& rhs ) const {
15     return unit< I1 - Q1, I2 - Q2 >();
16   }
20 int main()
22   const unit<1,0> u1;
23   const unit<2,0> u2;
25   unit<-1,0> u3( u1 / u2 );