This is the mail archive of the gcc@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]

Re: typedef vs. typename confusion



> 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).



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