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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [instantiate11.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
// { dg-do assemble  }
2
// Origin: Neil Booth, from bug report #36
3
 
4
template  class vect;
5
template  vect operator-( const vect&, const vect& );
6
 
7
template 
8
class vect
9
{
10
public:
11
  vect( t a );
12
 
13
  vect( const vect& v );
14
  ~vect();
15
 
16
  vect& operator=( const vect& v );
17
  vect  operator-( void ) const;
18
  friend vect (::operator- <>)( const vect&, const vect& );
19
 
20
private:
21
  t a_;
22
};
23
 
24
template  inline
25
vect::vect( t a )
26
: a_(a)
27
{
28
}
29
 
30
template  inline
31
vect::vect( const vect& v )
32
: a_(v.a_)
33
{
34
}
35
 
36
template  inline
37
vect::~vect()
38
{
39
}
40
 
41
template  inline vect&
42
vect::operator=( const vect& v )
43
{
44
   a_ = v.a_;
45
   return *this;
46
}
47
 
48
template  inline vect
49
vect::operator-( void ) const
50
{
51
  return vect( -a_ );
52
}
53
 
54
template  inline vect
55
operator-( const vect& u, const vect& v )
56
{
57
  return vect( u.a_ - v.a_ );
58
}
59
 
60
int
61
main( void )
62
{
63
  vect a( 1.0 ), b( 0.0 );
64
  b = -a;
65
}

powered by: WebSVN 2.1.0

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