This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs-1.1.1 on Solaris2.6 bug?
On Dec 6, 1998, Igor Markov <imarkov@math.ucla.edu> wrote:
> Alexandre Oliva wrote:
>> any type member of Sequence must be prefixed by the keyword
>> `typename'. Welcome to ISO C++:
> OTOH, I expect a ton of problems with "anachronisms" like this and other
> error situations. A compiler that only processes correct code and gives
> uninformative diagnostics for wrong code won't be very popular, esp. for
> ports.
AFAIK, egcs will accept some anachronisms like this where possible.
But this is not always possible :-(
template <class T> void foo() {
for(T::something *somethingelse;;);
}
Consider the declaration above. When you don't know what `T' is, it's
not possible to decide whether something is the name of a type or of a
field, so it's not possible to know whether the statement is a
declaration of a pointer to a T::something or a multiplication of that
something with somethingelse. See the problem? That's why `typename'
is mandated by the Standard.
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Universidade Estadual de Campinas, SP, Brasil