Renaming IS_AGGR_TYPE & co
Paolo Carlini
pcarlini@suse.de
Tue Mar 11 22:22:00 GMT 2008
Hi Mark,
>> - else if (! is_aggr_type (base, 1))
>> + else if (TREE_CODE (base) != TYPENAME_TYPE
>> + && TREE_CODE (base) != TEMPLATE_TYPE_PARM
>> + && TREE_CODE (base) != BOUND_TEMPLATE_TEMPLATE_PARM
>> + && ! is_class_type (base, 1))
>> result = NULL_TREE;
>>
>> allows the testsuite to pass...
> I think that in this case you want MAYBE_CLASS_TYPE_P.
>
> Here, the compiler is checking to see if the type is a valid base
> class type. If it's a template type parameter, it *might* be a class
> type -- we just don't know yet. So, we want to accept it.
Ok, thanks, now I see the logic pretty clearly. Note however, that the
current is_aggr_type (would be is_class_type), beyond MAYBE_CLASS_TYPE_P
emits *error messages*, which currently wrongly talk about
""aggregate"". I understand that in this case only in order to preserve
and improve the current behavior I should open code a check of
MAYBE_CLASS_TYPE_P and an error message talking about... what?!?... just
"class type" would be Ok for the error message?
Paolo.
More information about the Gcc-patches
mailing list