* gcc.target/i386/mpx/hard-reg-1-nov.c (mpx_test): Use "esp"
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / crash68.C
blob9afeae09aaf3e2d8447fa70998f0ec3802d1a6c9
1 // { 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 <nathan@codesourcery.com>
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.
11 #include <iostream>
13 using namespace std;
15 template <class A, class B, class C, C& c, bool d> class eo: public A
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;
29 struct XY
31   float x, y;
33   XY(): x(1), y(0.1) {}
36 float fitness(const XY& a)
38   return a.x + a.y;
41 struct fitness2
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   }
54 struct fitness3
56   float operator()(const XY& a)
57   {
58     return a.x / a.y;
59   }
62 fitness2 f2;
63 fitness3 f3;
65 int main()
67   eo<XY, float, fitness2, f2, true> eo2;
68   eo<XY, float, fitness3, f3, true> eo3;
70   return 0;