[PATCH] More implicit typename fixes

Jason Merrill jason@redhat.com
Fri Dec 21 16:56:00 GMT 2001


>>>>> "Nathan" == Nathan Myers <ncm-nospam@cantrip.org> writes:

> On Fri, Dec 21, 2001 at 11:58:51PM +0100, Paolo Carlini wrote:
>> Nathan Myers wrote:
>> 
>> > On Fri, Dec 21, 2001 at 10:44:29PM +0100, Paolo Carlini wrote:
>> > >       typedef typename ctype::mask  mask;       <====== 169
>> >
>> > That doesn't look spurious to me.  I suspect (without looking)
>> > that what's wanted is
>> >
>> >       typedef typename __ctype_abstract_base<_CharT>::mask  mask;
>> 
>> Thanks for your feedback. In fact, as you may have noticed from my
>> previous fix for a similar problem in stl_rope.h, this is the kind of
>> typedef I'm tempted to use ;-)
>> 
>> However, the new parser likes also typedef typename ctype::mask mask
>> (checked a moment ago). Is that legal too? I'm tempted to think so.

> Actually, looking deeper, it would be better just to use 

>   typedef ::std::ctype_base::mask  mask;

I disagree; 'typename ctype::mask' is the simplest form, since there is no
'inherited' keyword, and the compiler should accept it.  Paolo, please send
Nathan Sidwell a bug report about his warning being overeager.

> or maybe even

>   using ctype_base::mask;

> if it works.

That doesn't help the compiler to see that it's a type, so I don't think it
should.

Jason



More information about the Libstdc++ mailing list