Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.pt / crash68.C
blobe665787dbeabee1642656477def20723558fb5cb
1 // { dg-do assemble  }
2 // 
3 // Copyright (C) 2001 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 25 Jul 2001 <nathan@codesourcery.com>
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.
10 #include <iostream>
12 using namespace std;
14 template <class A, class B, class C, C& c, bool d> class eo: public A
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;
28 struct XY
30   float x, y;
32   XY(): x(1), y(0.1) {}
35 float fitness(const XY& a)
37   return a.x + a.y;
40 struct fitness2
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   }
53 struct fitness3
55   float operator()(const XY& a)
56   {
57     return a.x / a.y;
58   }
61 fitness2 f2;
62 fitness3 f3;
64 int main()
66   eo<XY, float, fitness2, f2, true> eo2;
67   eo<XY, float, fitness3, f3, true> eo3;
69   return 0;