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]

Re: Unresolved issue


>>>>> "Jason" == Jason Merrill <jason@cygnus.com> writes:

    Jason> CLASS_TYPE_P should also reject TYPENAME_TYPE.  Or check
    Jason> IS_AGGR_TYPE_CODE && IS_AGGR_TYPE; that's probably better.

Thanks; I did this in the attached patch.

-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com

1998-08-25  Mark Mitchell  <mark@markmitchell.com>

	* cp-tree.h (CLASS_TYPE_P): Revise definition.

Index: cp-tree.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/cp-tree.h,v
retrieving revision 1.116
diff -c -p -r1.116 cp-tree.h
*** cp-tree.h	1998/08/24 12:04:36	1.116
--- cp-tree.h	1998/08/25 18:29:43
*************** enum languages { lang_c, lang_cplusplus,
*** 499,512 ****
  #define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
  
  /* Nonzero if T is a class (or struct or union) type.  Also nonzero
!    for template type parameters.  Despite its name, this macro has
!    nothing to do with the definition of aggregate given in the
!    standard.  Think of this macro as MAYBE_CLASS_TYPE_P.  */
  #define IS_AGGR_TYPE(t)		(TYPE_LANG_FLAG_5 (t))
  
! /* Nonzero if T is a class type.  Zero for template type parameters.  */
  #define CLASS_TYPE_P(t) \
!   (IS_AGGR_TYPE (t) && TREE_CODE (t) != TEMPLATE_TYPE_PARM)
  
  #define IS_AGGR_TYPE_CODE(t)	(t == RECORD_TYPE || t == UNION_TYPE)
  #define IS_AGGR_TYPE_2(TYPE1,TYPE2) \
--- 499,513 ----
  #define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
  
  /* Nonzero if T is a class (or struct or union) type.  Also nonzero
!    for template type parameters and typename types.  Despite its name,
!    this macro has nothing to do with the definition of aggregate given
!    in the standard.  Think of this macro as MAYBE_CLASS_TYPE_P.  */
  #define IS_AGGR_TYPE(t)		(TYPE_LANG_FLAG_5 (t))
  
! /* Nonzero if T is a class type.  Zero for template type parameters,
!    typename types, and so forth.  */
  #define CLASS_TYPE_P(t) \
!   (IS_AGGR_TYPE (t) && IS_AGGR_TYPE_CODE (TREE_CODE (t)))
  
  #define IS_AGGR_TYPE_CODE(t)	(t == RECORD_TYPE || t == UNION_TYPE)
  #define IS_AGGR_TYPE_2(TYPE1,TYPE2) \


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