This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Internal compiler error 2000 - is this the Millenium bug?!?


I'm getting some intriguing behaviour from this toy program:

class Dummy1 {};
class Dummy2 {};

template <class T1> class X {
public:
  void m() {;}
};

class Z : public X<Dummy1> {
};

class W : public X<Dummy2>, public Z {
public:
  void f() {X<Dummy2>::m();}
};

int main()
{
  W z;
  z.f();
  //z.W::X<Dummy2>::m();
  z.Z::template X<Dummy2>::m();
}

I'm using gcc version egcs-2.92.27 19981206 (gcc2 ss-980609 experimental)
on a P200, Solaris 2.5.

As it stands, I get

test.cpp: In function `int main()':
test.cpp:21: Internal compiler error 2000.

If I change 'Z' to 'W' in line 21, I get

test.cpp:21: no class template named `X' in `class W'

However, neither of these are what I'm concerned with. The commented-out
line is my concern. Uncommented, I get

test.cpp:20: request for member `X' is ambiguous
test.cpp:20: parse error before `>'

I don't understand why I can disambiguate X<Dummy2>::m() within W (i.e. in
the definition of function f()) but not outside. Is it my problem?

                  |================================================| ---
            I---, |-=|        Dave Maley, M.A., M.Phil.         |=-|  ----
       -----U ==| |================================================|   ---
       | :) U ==| |  Computer Manager, St. Mary's College, Belfast | ---
  -----'----U   | |________________________________________________|   ---
  |)___()  'U   |______====____   \________________________________|  -----
 [_/,-,\"--"----- // ,-,  ,-,\\\   |/         //,-,  ,-,  ,-,\\ __#  ---
   ( 0 )====#####// ( 0 )( 0 )''-  o          '( 0 )( 0 )( 0 )''
----'-'--------------'-'--'-'-------------------'-'--'-'--'-'--------------

St. Mary's College, Belfast
191 Falls Road
Belfast, BT12 6FE

Tel: (+44) 1232 327678 x312
Fax: (+44) 1232 333719




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]