2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / crash38.C
blobd7f0552caa5c420a2e79e6f55005a7ad0f49fbdc
1 // { dg-do assemble  }
2 // GROUPS passed old-abort
3 /*
4    I received the following message when using g++ (version 2.3.3):
6    main.cc: In method 'Implicit<implicit<INTEGER,2>,3>::Implicit()':
7    main.cc: Internal compiler error 241.
8    main.cc: Please report this to 'bug-g++@prep.ai.mit.edu'
9    */
11 #include <iostream>
13 class INTEGER {
14 int x;
15 public:
16    typedef int BASE;
17    INTEGER(int y) : x(y) {}
18    INTEGER() {}
19    void encode() { std::cout << "Integer encoder";}
20    int operator=(int y) { x=y; return x; }
21    operator int() {return x; }
24 template< class T,  int n> class Implicit : public T {
25    public:
26      typedef typename T::BASE BASE;
27      Implicit(BASE value ): T(value) {};
28      Implicit() : T() {};
29      int myTag() { return n; }
30      void encode() { T::encode(); }
31      BASE operator=(BASE t) { return T::operator=(t); }
34 int
35 main() 
37   Implicit<Implicit<INTEGER, 2> ,  3> y;
39   y = 10;