OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [unify1.C] - Blame information for rev 853

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// Test non-type template argument folding.
2
// Origin: smacdonald@seimac.com
3
 
4
// { dg-do compile }
5
 
6
template < int I1, int I2 >
7
class unit
8
{
9
public:
10
  unit() {}
11
  unit( const unit& ) {}
12
 
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
  }
17
 
18
};
19
 
20
int main()
21
{
22
  const unit<1,0> u1;
23
  const unit<2,0> u2;
24
 
25
  unit<-1,0> u3( u1 / u2 );
26
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.