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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc4/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [crash68.C] - Blame information for rev 519

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
// { dg-prune-output "mangled name" }
3
//
4
// Copyright (C) 2001 Free Software Foundation, Inc.
5
// Contributed by Nathan Sidwell 25 Jul 2001 
6
 
7
// Origin: gustavo@geneura.ugr.es
8
// Bug 3624. Template instantiation of a reference type was not
9
// converted from reference when doing a call.
10
 
11
#include 
12
 
13
using namespace std;
14
 
15
template  class eo: public A
16
{
17
public:
18
  eo()
19
  {
20
    cout << this->x << " " << this->y << " "
21
         << c(*this) << " "
22
         << ((d)?"true":"false") << endl;
23
  }
24
 
25
private:
26
  B b;
27
};
28
 
29
struct XY
30
{
31
  float x, y;
32
 
33
  XY(): x(1), y(0.1) {}
34
};
35
 
36
float fitness(const XY& a)
37
{
38
  return a.x + a.y;
39
}
40
 
41
struct fitness2
42
{
43
  float operator()(const XY& a)
44
  {
45
    return a.x - a.y;
46
  }
47
 
48
  float f(const XY& a)
49
  {
50
    return a.x - a.y;
51
  }
52
};
53
 
54
struct fitness3
55
{
56
  float operator()(const XY& a)
57
  {
58
    return a.x / a.y;
59
  }
60
};
61
 
62
fitness2 f2;
63
fitness3 f3;
64
 
65
int main()
66
{
67
  eo eo2;
68
  eo eo3;
69
 
70
  return 0;
71
}

powered by: WebSVN 2.1.0

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