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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [crash68.C] - Blame information for rev 154

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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