1 // { dg-do assemble  }
2 // GROUPS passed old-abort
3 /*
4    I received the following message when using g++ (version 2.3.3):
5 
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    */
10 
11 #include <iostream>
12 
13 class INTEGER {
14 int x;
15 public:
16    typedef int BASE;
INTEGER(int y)17    INTEGER(int y) : x(y) {}
INTEGER()18    INTEGER() {}
encode()19    void encode() { std::cout << "Integer encoder";}
20    int operator=(int y) { x=y; return x; }
21    operator int() {return x; }
22 };
23 
24 template< class T,  int n> class Implicit : public T {
25    public:
26      typedef typename T::BASE BASE;
Implicit(BASE value)27      Implicit(BASE value ): T(value) {}
Implicit()28      Implicit() : T() {}
myTag()29      int myTag() { return n; }
encode()30      void encode() { T::encode(); }
31      BASE operator=(BASE t) { return T::operator=(t); }
32 };
33 
34 int
main()35 main()
36 {
37   Implicit<Implicit<INTEGER, 2> ,  3> y;
38 
39   y = 10;
40 }
41 
42 
43 
44