This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: typedef vs. typename confusion
- To: Gabriel dot Dos-Reis at dptmaths dot ens-cachan dot fr (Gabriel Dos Reis)
- Subject: Re: typedef vs. typename confusion
- From: Joe Buck <jbuck at synopsys dot com>
- Date: Tue, 4 Aug 98 9:32:43 PDT
- Cc: egcs at cygnus dot com
> There was a related posting two or three weeks ago. It was argued
> that egcs, unilaterally, supplies the keyword 'typename' where needed
> --or more accurately, where he thinks he could do so without transmuting
> programs. I strongly objected against such *default* behaviour. I hope
> this report will be enough convincing to supply the standard
> behaviour, by *default*.
Rigorous enforcement of the "typename" rule will break a lot of old code.
(It was great fun the first time I attempted to port some template-heavy
code to HP's aC++, which takes a very anal-retentive approach to standards
conformance, which is OK if you actually manage to implement the standard
correctly but there were many goofs).
It's best to break old code in stages: first provide a warning, and then
later the warning becomes an error.
That is, whereever the compiler is in effect inserting "typename" (or,
to be more correct, where the compiler is assuming that a name refers
to a type, even though by the strict ISO C++ rules it should not), it
should issue a warning. This warning should have its own flag but be
turned on by -Wall.
(Of course, this is for future work, not for egcs-1.1, which is feature-
frozen).