egcs-19980425: typedef question

Andrew Pollard andrew@odie.demon.co.uk
Wed Apr 29 18:36:00 GMT 1998


Hello,

[ I'm not sure whether this is to do with the new C++ spec, or egcs
  getting it wrong...]

 I've just tried to compile up some of our work source code with
egcs-19980425 and came across a problem.

The following short code snippet indicates the problem

typedef.cc:
--------------------------------------------------------------------
struct B1 {
};

typedef B1 B2;

struct A {
	operator B1();
};

A::operator B2() {
}
--------------------------------------------------------------------

% g++ -v
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.25/specs
gcc version egcs-2.91.25 19980425 (gcc2 ss-980401 experimental)
% g++ -c typedef.cc
typedef.cc:10: no `A::operator B2()' member function declared in class `A'

Whereas it works fine with gcc-2.7.2.2 and egcs-1.0.2, and earlier
egcs snapshots (not 19980418, but 980328 works).

I realise that the code is a bit strange (the actual example comes
from B1 and B2 being Color and Colour - an attempt to not need to
worry about the 'correct' spelling of Colour).

Is this some new strengthening of the specs for C++ wrt typedef's or
is egcs getting it wrong?

Thanks,
 Andrew.
--
   Andrew Pollard, Auto Simulations Ltd. UK.    | home: andrew@odie.demon.co.uk
   2 Milbanke Court, Milbanke Way, Bracknell    | work: andrewp@autosim.com
Tel:+44(0)1344 426486x103 Fax:+44(0)1344 426615 | http://www.odie.demon.co.uk





More information about the Gcc mailing list