This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: Renaming IS_AGGR_TYPE & co


Paolo Carlini wrote:
Some additional details...
You are right, in the sense that actually the TYPENAME_TYPE comes from a
different caller, finish_base_specifier (in semantics.c). The below is
is the complete call stack. Then, would it make sense to change somehow
finish_base_specifier to allow for TYPENAME_TYPEs?
Doing, in finish_base_specifier, something like:

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

Thanks,

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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