FreeBSD/contrib/gcc/cp/class.c
/* FIELD is a non bit-field.  We are finishing the processing for its
   enclosing type T.  Issue any appropriate messages and set appropriate
   flags.  */
FIELD is a non bit-field.  We are finishing the processing for its
enclosing type T.  Issue any appropriate messages and set appropriate
flags.
FIELD is a non bit - field . We are finishing the processing for its enclosing type T . Issue any appropriate messages and set appropriate flags .
static void
check_field_decl (tree field,
		  tree t,
		  int* cant_have_const_ctor,
		  int* no_const_asn_ref,
		  int* any_default_members)
{
  tree type = strip_array_types (TREE_TYPE (field));
  if (ANON_UNION_TYPE_P (type))
    ;
  else if (ANON_AGGR_TYPE_P (type))
    {
      tree fields;
      for (fields = TYPE_FIELDS (type); fields; fields = TREE_CHAIN (fields))
	if (TREE_CODE (fields) == FIELD_DECL && !DECL_C_BIT_FIELD (field))
	  check_field_decl (fields, t, cant_have_const_ctor,
			    no_const_asn_ref, any_default_members);
    }
  else if (CLASS_TYPE_P (type))
    {
      abstract_virtuals_error (field, type);
      if (TREE_CODE (t) == UNION_TYPE)
	{
	  if (TYPE_NEEDS_CONSTRUCTING (type))
	    error ("member %q+#D with constructor not allowed in union",
		   field);
	  if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type))
	    error ("member %q+#D with destructor not allowed in union", field);
	  if (TYPE_HAS_COMPLEX_ASSIGN_REF (type))
	    error ("member %q+#D with copy assignment operator not allowed in union",
		   field);
	}
      else
	{
	  TYPE_NEEDS_CONSTRUCTING (t) |= TYPE_NEEDS_CONSTRUCTING (type);
	  TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)
	    |= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type);
	  TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_HAS_COMPLEX_ASSIGN_REF (type);
	  TYPE_HAS_COMPLEX_INIT_REF (t) |= TYPE_HAS_COMPLEX_INIT_REF (type);
	}
      if (!TYPE_HAS_CONST_INIT_REF (type))
	*cant_have_const_ctor = 1;
      if (!TYPE_HAS_CONST_ASSIGN_REF (type))
	*no_const_asn_ref = 1;
    }
  if (DECL_INITIAL (field) != NULL_TREE)
    {
      if (TREE_CODE (t) == UNION_TYPE && any_default_members != 0)
	error ("multiple fields in union %qT initialized", t);
      *any_default_members = 1;
    }
}
static void check_field_decl ( tree field , tree t , int * cant_have_const_ctor , int * no_const_asn_ref , int * any_default_members ) { tree type = strip_array_types ( TREE_TYPE ( field ) ) ; if ( ANON_UNION_TYPE_P ( type ) ) ; else if ( ANON_AGGR_TYPE_P ( type ) ) { tree fields ; for ( fields = TYPE_FIELDS ( type ) ; fields ; fields = TREE_CHAIN ( fields ) ) if ( TREE_CODE ( fields ) == FIELD_DECL && ! DECL_C_BIT_FIELD ( field ) ) check_field_decl ( fields , t , cant_have_const_ctor , no_const_asn_ref , any_default_members ) ; } else if ( CLASS_TYPE_P ( type ) ) { abstract_virtuals_error ( field , type ) ; if ( TREE_CODE ( t ) == UNION_TYPE ) { if ( TYPE_NEEDS_CONSTRUCTING ( type ) ) error ( " " , field ) ; if ( TYPE_HAS_NONTRIVIAL_DESTRUCTOR ( type ) ) error ( " " , field ) ; if ( TYPE_HAS_COMPLEX_ASSIGN_REF ( type ) ) error ( " " , field ) ; } else { TYPE_NEEDS_CONSTRUCTING ( t ) |= TYPE_NEEDS_CONSTRUCTING ( type ) ; TYPE_HAS_NONTRIVIAL_DESTRUCTOR ( t ) |= TYPE_HAS_NONTRIVIAL_DESTRUCTOR ( type ) ; TYPE_HAS_COMPLEX_ASSIGN_REF ( t ) |= TYPE_HAS_COMPLEX_ASSIGN_REF ( type ) ; TYPE_HAS_COMPLEX_INIT_REF ( t ) |= TYPE_HAS_COMPLEX_INIT_REF ( type ) ; } if ( ! TYPE_HAS_CONST_INIT_REF ( type ) ) * cant_have_const_ctor = 1 ; if ( ! TYPE_HAS_CONST_ASSIGN_REF ( type ) ) * no_const_asn_ref = 1 ; } if ( DECL_INITIAL ( field ) != NULL_TREE ) { if ( TREE_CODE ( t ) == UNION_TYPE && any_default_members != 0 ) error ( " " , t ) ; * any_default_members = 1 ; } }
FIELD is a non bit-field.
FIELD is a non bit - field .
/* An anonymous union cannot contain any fields which would change
     the settings of CANT_HAVE_CONST_CTOR and friends.  */ /* And, we don't set TYPE_HAS_CONST_INIT_REF, etc., for anonymous
     structs.  So, we recurse through their fields here.  */ /* Check members with class type for constructors, destructors,
     etc.  */ /* Never let anything with uninheritable virtuals
	 make it through without complaint.  */ /* `build_class_init_list' does not recognize
	 non-FIELD_DECLs.  */