+2008-03-21 Paolo Carlini <pcarlini@suse.de>
+
+ * cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
+ (SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P.
+ (IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P.
+ (PROMOTES_TO_AGGR_TYPE): Remove.
+ (CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust.
+ * typeck.c (unary_complex_lvalue, build_modify_expr,
+ convert_for_initialization): Adjust.
+ * init.c (is_aggr_type): Remove.
+ (is_class_type): Add.
+ (build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init,
+ build_delete): Adjust.
+ * lex.c (make_aggr_type): Remove.
+ (make_class_type): Add.
+ (cxx_make_type): Adjust.
+ * class.c (finish_struct_1, fixed_type_or_null, is_empty_class):
+ Adjust.
+ * decl.c (build_typename_type, make_typename_type,
+ make_unbound_class_template, cxx_init_decl_processing,
+ check_tag_decl, groktypename, start_decl_1, layout_var_decl,
+ check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms,
+ grok_op_properties, xref_tag, check_function_type): Adjust.
+ * call.c (check_dtor_name, standard_conversion, implicit_conversion,
+ add_builtin_candidate, add_builtin_candidates,
+ build_user_type_conversion_1, convert_like_real, build_cxx_call,
+ is_subseq, compare_ics): Adjust.
+ * method.c (use_thunk): Adjust.
+ * rtti.c (build_dynamic_cast_1, create_pseudo_type_info,
+ create_tinfo_types): Adjust.
+ * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
+ build_up_reference, convert_to_reference, convert_from_reference,
+ ocp_convert, build_expr_type_conversion): Adjust.
+ * tree.c (bind_template_template_parm, error_type): Adjust.
+ * dump.c (cp_dump_tree): Adjust.
+ * search.c (lookup_member): Adjust.
+ * friend.c (make_friend_class, do_friend): Adjust.
+ * typeck2.c (store_init_value, process_init_constructor_array,
+ process_init_constructor_record, build_x_arrow, build_m_component_ref,
+ build_functional_cast): Adjust.
+ * pt.c (finish_member_template_decl, process_template_parm,
+ lookup_template_class, tsubst_function_type, tsubst,
+ tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc):
+ Adjust.
+ * semantics.c (begin_class_definition, finish_base_specifier,
+ finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type):
+ Adjust.
+ * name-lookup.c (constructor_name_p, push_overloaded_decl,
+ do_class_using_decl, lookup_qualified_name,
+ maybe_process_template_type_declaration): Adjust.
+ * decl2.c (grok_array_decl, check_member_template,
+ constrain_class_visibility): Adjust.
+ * parser.c (cp_parser_class_name): Adjust.
+
2008-03-18 Paolo Bonzini <bonzini@gnu.org>
* cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.
/* OK */;
else if (TREE_CODE (name) == IDENTIFIER_NODE)
{
- if ((IS_AGGR_TYPE (basetype) && name == constructor_name (basetype))
+ if ((MAYBE_CLASS_TYPE_P (basetype)
+ && name == constructor_name (basetype))
|| (TREE_CODE (basetype) == ENUMERAL_TYPE
&& name == TYPE_IDENTIFIER (basetype)))
return true;
else if (!same_type_p (fbase, tbase))
return NULL;
}
- else if (IS_AGGR_TYPE (TREE_TYPE (from))
- && IS_AGGR_TYPE (TREE_TYPE (to))
+ else if (MAYBE_CLASS_TYPE_P (TREE_TYPE (from))
+ && MAYBE_CLASS_TYPE_P (TREE_TYPE (to))
/* [conv.ptr]
An rvalue of type "pointer to cv D," where D is a
else if (fcode == VECTOR_TYPE && tcode == VECTOR_TYPE
&& vector_types_convertible_p (from, to, false))
return build_conv (ck_std, to, conv);
- else if (IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from)
+ else if (MAYBE_CLASS_TYPE_P (to) && MAYBE_CLASS_TYPE_P (from)
&& is_properly_derived_from (from, to))
{
if (conv->kind == ck_rvalue)
return conv;
if (expr != NULL_TREE
- && (IS_AGGR_TYPE (from)
- || IS_AGGR_TYPE (to))
+ && (MAYBE_CLASS_TYPE_P (from)
+ || MAYBE_CLASS_TYPE_P (to))
&& (flags & LOOKUP_NO_CONVERSION) == 0)
{
struct z_candidate *cand;
tree c1 = TREE_TYPE (type1);
tree c2 = TYPE_PTRMEM_CLASS_TYPE (type2);
- if (IS_AGGR_TYPE (c1) && DERIVED_FROM_P (c2, c1)
+ if (MAYBE_CLASS_TYPE_P (c1) && DERIVED_FROM_P (c2, c1)
&& (TYPE_PTRMEMFUNC_P (type2)
|| is_complete (TYPE_PTRMEM_POINTED_TO_TYPE (type2))))
break;
|| (TYPE_PTR_P (type1) && TYPE_PTR_P (type2))
|| (TYPE_PTRMEM_P (type1) && TYPE_PTRMEM_P (type2))
|| TYPE_PTRMEMFUNC_P (type1)
- || IS_AGGR_TYPE (type1)
+ || MAYBE_CLASS_TYPE_P (type1)
|| TREE_CODE (type1) == ENUMERAL_TYPE))
{
build_builtin_candidate
{
if (! args[i])
;
- else if (IS_AGGR_TYPE (argtypes[i]))
+ else if (MAYBE_CLASS_TYPE_P (argtypes[i]))
{
tree convs;
/* We represent conversion within a hierarchy using RVALUE_CONV and
BASE_CONV, as specified by [over.best.ics]; these become plain
constructor calls, as specified in [dcl.init]. */
- gcc_assert (!IS_AGGR_TYPE (fromtype) || !IS_AGGR_TYPE (totype)
+ gcc_assert (!MAYBE_CLASS_TYPE_P (fromtype) || !MAYBE_CLASS_TYPE_P (totype)
|| !DERIVED_FROM_P (totype, fromtype));
- if (IS_AGGR_TYPE (totype))
+ if (MAYBE_CLASS_TYPE_P (totype))
ctors = lookup_fnfields (totype, complete_ctor_identifier, 0);
- if (IS_AGGR_TYPE (fromtype))
+ if (MAYBE_CLASS_TYPE_P (fromtype))
{
tree to_nonref = non_reference (totype);
if (same_type_ignoring_top_level_qualifiers_p (to_nonref, fromtype) ||
conversion, but is not considered during overload resolution.
If the target is a class, that means call a ctor. */
- if (IS_AGGR_TYPE (totype)
+ if (MAYBE_CLASS_TYPE_P (totype)
&& (inner >= 0 || !lvalue_p (expr)))
{
expr = (build_temp
{
case ck_rvalue:
expr = convert_bitfield_to_declared_type (expr);
- if (! IS_AGGR_TYPE (totype))
+ if (! MAYBE_CLASS_TYPE_P (totype))
return expr;
/* Else fall through. */
case ck_base:
if (fn == error_mark_node)
return error_mark_node;
- if (IS_AGGR_TYPE (TREE_TYPE (fn)))
+ if (MAYBE_CLASS_TYPE_P (TREE_TYPE (fn)))
fn = build_cplus_new (TREE_TYPE (fn), fn);
return convert_from_reference (fn);
}
bool
is_properly_derived_from (tree derived, tree base)
{
- if (!IS_AGGR_TYPE_CODE (TREE_CODE (derived))
- || !IS_AGGR_TYPE_CODE (TREE_CODE (base)))
+ if (!CLASS_TYPE_P (derived) || !CLASS_TYPE_P (base))
return false;
/* We only allow proper derivation here. The DERIVED_FROM_P macro
}
if (deref_from_type1 != NULL_TREE
- && IS_AGGR_TYPE_CODE (TREE_CODE (deref_from_type1))
- && IS_AGGR_TYPE_CODE (TREE_CODE (deref_from_type2)))
+ && RECORD_OR_UNION_CODE_P (TREE_CODE (deref_from_type1))
+ && RECORD_OR_UNION_CODE_P (TREE_CODE (deref_from_type2)))
{
/* This was one of the pointer or pointer-like conversions.
return -1;
}
}
- else if (IS_AGGR_TYPE_CODE (TREE_CODE (deref_to_type1))
- && IS_AGGR_TYPE_CODE (TREE_CODE (deref_to_type2)))
+ else if (RECORD_OR_UNION_CODE_P (TREE_CODE (deref_to_type1))
+ && RECORD_OR_UNION_CODE_P (TREE_CODE (deref_to_type2)))
{
/* [over.ics.rank]
/* Functions related to building classes and their related objects.
Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
remove_zero_width_bit_fields (t);
/* Create the version of T used for virtual bases. We do not use
- make_aggr_type for this version; this is an artificial type. For
+ make_class_type for this version; this is an artificial type. For
a POD type, we just reuse T. */
if (CLASSTYPE_NON_POD_P (t) || CLASSTYPE_EMPTY_P (t))
{
if (COMPLETE_TYPE_P (t))
{
- gcc_assert (IS_AGGR_TYPE (t));
+ gcc_assert (MAYBE_CLASS_TYPE_P (t));
error ("redefinition of %q#T", t);
popclass ();
return;
case VAR_DECL:
case FIELD_DECL:
if (TREE_CODE (TREE_TYPE (instance)) == ARRAY_TYPE
- && IS_AGGR_TYPE (TREE_TYPE (TREE_TYPE (instance))))
+ && MAYBE_CLASS_TYPE_P (TREE_TYPE (TREE_TYPE (instance))))
{
if (nonnull)
*nonnull = 1;
case TARGET_EXPR:
case PARM_DECL:
case RESULT_DECL:
- if (IS_AGGR_TYPE (TREE_TYPE (instance)))
+ if (MAYBE_CLASS_TYPE_P (TREE_TYPE (instance)))
{
if (nonnull)
*nonnull = 1;
if (type == error_mark_node)
return 0;
- if (! IS_AGGR_TYPE (type))
+ if (! MAYBE_CLASS_TYPE_P (type))
return 0;
/* In G++ 3.2, whether or not a class was empty was determined by
/* Definitions for C++ parsing and type checking.
Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
2: Unused
3: TYPE_FOR_JAVA.
4: TYPE_HAS_NONTRIVIAL_DESTRUCTOR
- 5: IS_AGGR_TYPE.
+ 5: CLASS_TYPE_P.
6: TYPE_DEPENDENT_P_VALID
Usage of DECL_LANG_FLAG_?:
/* Nonzero if T is a class (or struct or union) type. Also nonzero
for template type parameters, typename types, and instantiated
- template template 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. Keep
- these checks in ascending code order. */
-#define IS_AGGR_TYPE(T) \
+ template template parameters. Keep these checks in ascending code
+ order. */
+#define MAYBE_CLASS_TYPE_P(T) \
(TREE_CODE (T) == TEMPLATE_TYPE_PARM \
|| TREE_CODE (T) == TYPENAME_TYPE \
|| TREE_CODE (T) == TYPEOF_TYPE \
|| TREE_CODE (T) == DECLTYPE_TYPE \
|| TYPE_LANG_FLAG_5 (T))
-/* Set IS_AGGR_TYPE for T to VAL. T must be a class, struct, or
+/* Set CLASS_TYPE_P for T to VAL. T must be a class, struct, or
union type. */
-#define SET_IS_AGGR_TYPE(T, VAL) \
+#define SET_CLASS_TYPE_P(T, VAL) \
(TYPE_LANG_FLAG_5 (T) = (VAL))
/* 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_CODE (TREE_CODE (T)) && TYPE_LANG_FLAG_5 (T))
+ (RECORD_OR_UNION_CODE_P (TREE_CODE (T)) && TYPE_LANG_FLAG_5 (T))
/* Nonzero if T is a class type but not an union. */
#define NON_UNION_CLASS_TYPE_P(T) \
(CLASS_TYPE_P (T) && TREE_CODE (T) != UNION_TYPE)
/* Keep these checks in ascending code order. */
-#define IS_AGGR_TYPE_CODE(T) \
+#define RECORD_OR_UNION_CODE_P(T) \
((T) == RECORD_TYPE || (T) == UNION_TYPE)
#define TAGGED_TYPE_P(T) \
(CLASS_TYPE_P (T) || TREE_CODE (T) == ENUMERAL_TYPE)
#define FUNCTION_FIRST_USER_PARM(NODE) \
skip_artificial_parms_for ((NODE), DECL_ARGUMENTS (NODE))
-#define PROMOTES_TO_AGGR_TYPE(NODE, CODE) \
- (((CODE) == TREE_CODE (NODE) \
- && IS_AGGR_TYPE (TREE_TYPE (NODE))) \
- || IS_AGGR_TYPE (NODE))
-
/* Nonzero iff TYPE is derived from PARENT. Ignores accessibility and
ambiguity issues. */
#define DERIVED_FROM_P(PARENT, TYPE) \
#define CLASSTYPE_NON_AGGREGATE(NODE) \
(LANG_TYPE_CLASS_CHECK (NODE)->non_aggregate)
#define TYPE_NON_AGGREGATE_CLASS(NODE) \
- (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE))
+ (MAYBE_CLASS_TYPE_P (NODE) && CLASSTYPE_NON_AGGREGATE (NODE))
/* Nonzero if there is a user-defined X::op=(x&) for this class. */
#define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_complex_assign_ref)
extern tree expand_member_init (tree);
extern void emit_mem_initializers (tree);
extern tree build_aggr_init (tree, tree, int);
-extern int is_aggr_type (tree, int);
+extern int is_class_type (tree, int);
extern tree get_type_value (tree);
extern tree build_zero_init (tree, tree, bool);
extern tree build_value_init (tree);
extern tree copy_decl (tree);
extern tree copy_type (tree);
extern tree cxx_make_type (enum tree_code);
-extern tree make_aggr_type (enum tree_code);
+extern tree make_class_type (enum tree_code);
extern void yyerror (const char *);
extern void yyhook (int);
extern bool cxx_init (void);
/* Language-level data type conversion for GNU C++.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
if (intype == error_mark_node)
return error_mark_node;
- if (IS_AGGR_TYPE (intype))
+ if (MAYBE_CLASS_TYPE_P (intype))
{
intype = complete_type (intype);
if (!COMPLETE_TYPE_P (intype))
if (TYPE_MAIN_VARIANT (type) != intype
&& TREE_CODE (type) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (type)) == RECORD_TYPE
- && IS_AGGR_TYPE (TREE_TYPE (type))
- && IS_AGGR_TYPE (TREE_TYPE (intype))
+ && MAYBE_CLASS_TYPE_P (TREE_TYPE (type))
+ && MAYBE_CLASS_TYPE_P (TREE_TYPE (intype))
&& TREE_CODE (TREE_TYPE (intype)) == RECORD_TYPE)
{
enum tree_code code = PLUS_EXPR;
if (TYPE_MAIN_VARIANT (type) != intype
&& TREE_CODE (TREE_TYPE (type)) == RECORD_TYPE
- && IS_AGGR_TYPE (TREE_TYPE (type))
- && IS_AGGR_TYPE (TREE_TYPE (intype))
+ && MAYBE_CLASS_TYPE_P (TREE_TYPE (type))
+ && MAYBE_CLASS_TYPE_P (TREE_TYPE (intype))
&& TREE_CODE (TREE_TYPE (intype)) == RECORD_TYPE)
{
enum tree_code code = PLUS_EXPR;
if ((flags & LOOKUP_PROTECT)
&& TYPE_MAIN_VARIANT (argtype) != TYPE_MAIN_VARIANT (target_type)
- && IS_AGGR_TYPE (argtype)
- && IS_AGGR_TYPE (target_type))
+ && MAYBE_CLASS_TYPE_P (argtype)
+ && MAYBE_CLASS_TYPE_P (target_type))
{
/* We go through lookup_base for the access control. */
tree binfo = lookup_base (argtype, target_type, ba_check, NULL);
can_convert_intype_to_type = can_convert (type, intype);
if (!can_convert_intype_to_type
- && (convtype & CONV_IMPLICIT) && IS_AGGR_TYPE (intype)
+ && (convtype & CONV_IMPLICIT) && MAYBE_CLASS_TYPE_P (intype)
&& ! (flags & LOOKUP_NO_CONVERSION))
{
/* Look for a user-defined conversion to lvalue that we can use. */
tree
force_rvalue (tree expr)
{
- if (IS_AGGR_TYPE (TREE_TYPE (expr)) && TREE_CODE (expr) != TARGET_EXPR)
+ if (MAYBE_CLASS_TYPE_P (TREE_TYPE (expr)) && TREE_CODE (expr) != TARGET_EXPR)
expr = ocp_convert (TREE_TYPE (expr), expr,
CONV_IMPLICIT|CONV_FORCE_TEMP, LOOKUP_NORMAL);
else
e = integral_constant_value (e);
- if (IS_AGGR_TYPE (type) && (convtype & CONV_FORCE_TEMP))
+ if (MAYBE_CLASS_TYPE_P (type) && (convtype & CONV_FORCE_TEMP))
/* We need a new temporary; don't take this shortcut. */;
else if (same_type_ignoring_top_level_qualifiers_p (type, TREE_TYPE (e)))
{
if (!flag_permissive)
return error_mark_node;
}
- if (IS_AGGR_TYPE (intype))
+ if (MAYBE_CLASS_TYPE_P (intype))
{
tree rval;
rval = build_type_conversion (type, e);
if (code == VECTOR_TYPE)
{
tree in_vtype = TREE_TYPE (e);
- if (IS_AGGR_TYPE (in_vtype))
+ if (MAYBE_CLASS_TYPE_P (in_vtype))
{
tree ret_val;
ret_val = build_type_conversion (type, e);
}
if (code == REAL_TYPE || code == COMPLEX_TYPE)
{
- if (IS_AGGR_TYPE (TREE_TYPE (e)))
+ if (MAYBE_CLASS_TYPE_P (TREE_TYPE (e)))
{
tree rval;
rval = build_type_conversion (type, e);
/* New C++ semantics: since assignment is now based on
memberwise copying, if the rhs type is derived from the
lhs type, then we may still do a conversion. */
- if (IS_AGGR_TYPE_CODE (code))
+ if (RECORD_OR_UNION_CODE_P (code))
{
tree dtype = TREE_TYPE (e);
tree ctor = NULL_TREE;
return error_mark_node;
if ((flags & LOOKUP_ONLYCONVERTING)
- && ! (IS_AGGR_TYPE (dtype) && DERIVED_FROM_P (type, dtype)))
+ && ! (MAYBE_CLASS_TYPE_P (dtype) && DERIVED_FROM_P (type, dtype)))
/* For copy-initialization, first we create a temp of the proper type
with a user-defined conversion sequence, then we direct-initialize
the target with the temp (see [dcl.init]). */
if (basetype == error_mark_node)
return error_mark_node;
- if (! IS_AGGR_TYPE (basetype))
+ if (! MAYBE_CLASS_TYPE_P (basetype))
switch (TREE_CODE (basetype))
{
case INTEGER_TYPE:
else
{
/* Build the TYPENAME_TYPE. */
- t = make_aggr_type (TYPENAME_TYPE);
+ t = cxx_make_type (TYPENAME_TYPE);
TYPE_CONTEXT (t) = ti.scope;
TYPENAME_TYPE_FULLNAME (t) = ti.template_id;
TYPENAME_IS_ENUM_P (t) = ti.enum_p;
if (dependent_type_p (context))
return build_typename_type (context, name, fullname, tag_type);
- if (!IS_AGGR_TYPE (context))
+ if (!MAYBE_CLASS_TYPE_P (context))
{
if (complain & tf_error)
error ("%q#T is not a class", context);
{
tree tmpl = NULL_TREE;
- if (IS_AGGR_TYPE (context))
+ if (MAYBE_CLASS_TYPE_P (context))
tmpl = lookup_field (context, name, 0, false);
if (!tmpl || !DECL_CLASS_TEMPLATE_P (tmpl))
}
/* Build the UNBOUND_CLASS_TEMPLATE. */
- t = make_aggr_type (UNBOUND_CLASS_TEMPLATE);
+ t = cxx_make_type (UNBOUND_CLASS_TEMPLATE);
TYPE_CONTEXT (t) = FROB_CONTEXT (context);
TREE_TYPE (t) = NULL_TREE;
SET_TYPE_STRUCTURAL_EQUALITY (t);
push_namespace (std_identifier);
bad_alloc_id = get_identifier ("bad_alloc");
- bad_alloc_type_node = make_aggr_type (RECORD_TYPE);
+ bad_alloc_type_node = make_class_type (RECORD_TYPE);
TYPE_CONTEXT (bad_alloc_type_node) = current_namespace;
bad_alloc_decl
= create_implicit_typedef (bad_alloc_id, bad_alloc_type_node);
if (declspecs->type
&& TYPE_P (declspecs->type)
&& ((TREE_CODE (declspecs->type) != TYPENAME_TYPE
- && IS_AGGR_TYPE (declspecs->type))
+ && MAYBE_CLASS_TYPE_P (declspecs->type))
|| TREE_CODE (declspecs->type) == ENUMERAL_TYPE))
declared_type = declspecs->type;
else if (declspecs->type == error_mark_node)
if (declared_type == NULL_TREE && ! saw_friend && !error_p)
pedwarn ("declaration does not declare anything");
/* Check for an anonymous union. */
- else if (declared_type && IS_AGGR_TYPE_CODE (TREE_CODE (declared_type))
+ else if (declared_type && RECORD_OR_UNION_CODE_P (TREE_CODE (declared_type))
&& TYPE_ANONYMOUS_P (declared_type))
{
/* 7/3 In a simple-declaration, the optional init-declarator-list
if (CLASS_TYPE_P (type))
warning (OPT_Wattributes, "ignoring attributes applied to class type %qT "
"outside of definition", type);
- else if (IS_AGGR_TYPE (type))
+ else if (MAYBE_CLASS_TYPE_P (type))
/* A template type parameter or other dependent type. */
warning (OPT_Wattributes, "ignoring attributes applied to dependent "
"type %qT without an associated declaration", type);
type = TREE_TYPE (decl);
complete_p = COMPLETE_TYPE_P (type);
- aggregate_definition_p = IS_AGGR_TYPE (type) && !DECL_EXTERNAL (decl);
+ aggregate_definition_p = MAYBE_CLASS_TYPE_P (type) && !DECL_EXTERNAL (decl);
/* If an explicit initializer is present, or if this is a definition
of an aggregate, then we need a complete type at this point.
/* Keep this code around in case we later want to control debug info
based on whether a type is "used". (jason 1999-11-11) */
- else if (!DECL_EXTERNAL (decl) && IS_AGGR_TYPE (ttype))
+ else if (!DECL_EXTERNAL (decl) && MAYBE_CLASS_TYPE_P (ttype))
/* Let debugger know it should output info for this type. */
note_debug_info_needed (ttype);
;
else if (TYPE_P (type) && TYPE_NEEDS_CONSTRUCTING (type))
goto initialize_aggr;
- else if (IS_AGGR_TYPE (type))
+ else if (MAYBE_CLASS_TYPE_P (type))
{
tree core_type = strip_array_types (type);
if (TREE_CODE (decl) == TYPE_DECL)
{
if (type != error_mark_node
- && IS_AGGR_TYPE (type) && DECL_NAME (decl))
+ && MAYBE_CLASS_TYPE_P (type) && DECL_NAME (decl))
{
if (TREE_TYPE (DECL_NAME (decl)) && TREE_TYPE (decl) != type)
warning (0, "shadowing previous type declaration of %q#D", decl);
is *not* defined. */
&& (!DECL_EXTERNAL (decl) || init))
{
- if (TYPE_FOR_JAVA (type) && IS_AGGR_TYPE (type))
+ if (TYPE_FOR_JAVA (type) && MAYBE_CLASS_TYPE_P (type))
{
tree jclass
= IDENTIFIER_GLOBAL_VALUE (get_identifier ("jclass"));
layout_type (type);
}
else if (TREE_CODE (decl) == FIELD_DECL
- && TYPE_FOR_JAVA (type) && IS_AGGR_TYPE (type))
+ && TYPE_FOR_JAVA (type) && MAYBE_CLASS_TYPE_P (type))
error ("non-static data member %qD has Java class type", decl);
/* Add this declaration to the statement-tree. This needs to happen
unqualified_variant
= build_ptrmemfunc_type (TYPE_MAIN_VARIANT (type));
- t = make_aggr_type (RECORD_TYPE);
+ t = make_class_type (RECORD_TYPE);
xref_basetypes (t, NULL_TREE);
/* Let the front end know this is a pointer to member function... */
TYPE_PTRMEMFUNC_FLAG (t) = 1;
- /* ... and not really an aggregate. */
- SET_IS_AGGR_TYPE (t, 0);
+ /* ... and not really a class type. */
+ SET_CLASS_TYPE_P (t, 0);
field = build_decl (FIELD_DECL, pfn_identifier, type);
fields = field;
if (type != error_mark_node
&& TYPE_FOR_JAVA (type)
- && IS_AGGR_TYPE (type))
+ && MAYBE_CLASS_TYPE_P (type))
{
error ("parameter %qD has Java class type", decl);
type = error_mark_node;
if (arg == error_mark_node)
return false;
- /* IS_AGGR_TYPE, rather than CLASS_TYPE_P, is used
+ /* MAYBE_CLASS_TYPE_P, rather than CLASS_TYPE_P, is used
because these checks are performed even on
template functions. */
- if (IS_AGGR_TYPE (arg) || TREE_CODE (arg) == ENUMERAL_TYPE)
+ if (MAYBE_CLASS_TYPE_P (arg)
+ || TREE_CODE (arg) == ENUMERAL_TYPE)
break;
}
if (t == class_type)
what = "the same type";
/* Don't force t to be complete here. */
- else if (IS_AGGR_TYPE (t)
+ else if (MAYBE_CLASS_TYPE_P (t)
&& COMPLETE_TYPE_P (t)
&& DERIVED_FROM_P (t, class_type))
what = "a base class";
}
else
{
- t = make_aggr_type (code);
+ t = make_class_type (code);
TYPE_CONTEXT (t) = context;
t = pushtag (name, t, scope);
}
}
else
{
- if (template_header_p && IS_AGGR_TYPE (t))
+ if (template_header_p && MAYBE_CLASS_TYPE_P (t))
{
if (!redeclare_class_template (t, current_template_parms))
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
if (dependent_type_p (return_type))
return;
if (!COMPLETE_OR_VOID_TYPE_P (return_type)
- || (TYPE_FOR_JAVA (return_type) && IS_AGGR_TYPE (return_type)))
+ || (TYPE_FOR_JAVA (return_type) && MAYBE_CLASS_TYPE_P (return_type)))
{
tree args = TYPE_ARG_TYPES (fntype);
type = non_reference (type);
/* If they have an `operator[]', use that. */
- if (IS_AGGR_TYPE (type) || IS_AGGR_TYPE (TREE_TYPE (index_exp)))
+ if (MAYBE_CLASS_TYPE_P (type) || MAYBE_CLASS_TYPE_P (TREE_TYPE (index_exp)))
expr = build_new_op (ARRAY_REF, LOOKUP_NORMAL,
array_expr, index_exp, NULL_TREE,
/*overloaded_p=*/NULL);
if (TREE_CODE (decl) == FUNCTION_DECL
|| (TREE_CODE (decl) == TYPE_DECL
- && IS_AGGR_TYPE (TREE_TYPE (decl))))
+ && MAYBE_CLASS_TYPE_P (TREE_TYPE (decl))))
{
/* The parser rejects template declarations in local classes. */
gcc_assert (!current_function_decl);
%qT has a field %qD whose type uses the anonymous namespace",
type, t);
}
- else if (IS_AGGR_TYPE (ftype)
+ else if (MAYBE_CLASS_TYPE_P (ftype)
&& vis < VISIBILITY_HIDDEN
&& subvis >= VISIBILITY_HIDDEN)
warning (OPT_Wattributes, "\
/* Tree-dumping functionality for intermediate representation.
- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>
return true;
}
- if (! IS_AGGR_TYPE (t))
+ if (! MAYBE_CLASS_TYPE_P (t))
break;
dump_child ("vfld", TYPE_VFIELD (t));
/* Help friends in C++.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007 Free Software Foundation, Inc.
+ 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
int class_template_depth = template_class_depth (type);
int friend_depth = processing_template_decl - class_template_depth;
- if (! IS_AGGR_TYPE (friend_type))
+ if (! MAYBE_CLASS_TYPE_P (friend_type))
{
error ("invalid type %qT declared %<friend%>", friend_type);
return;
bool funcdef_flag)
{
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
- gcc_assert (!ctype || IS_AGGR_TYPE (ctype));
+ gcc_assert (!ctype || MAYBE_CLASS_TYPE_P (ctype));
/* Every decl that gets here is a friend of something. */
DECL_FRIEND_P (decl) = 1;
expand_default_init (binfo, true_exp, exp, init, flags);
}
-/* Report an error if TYPE is not a user-defined, aggregate type. If
+/* Report an error if TYPE is not a user-defined, class type. If
OR_ELSE is nonzero, give an error message. */
int
-is_aggr_type (tree type, int or_else)
+is_class_type (tree type, int or_else)
{
if (type == error_mark_node)
return 0;
- if (! IS_AGGR_TYPE (type))
+ if (! CLASS_TYPE_P (type))
{
if (or_else)
- error ("%qT is not an aggregate type", type);
+ error ("%qT is not a class type", type);
return 0;
}
return 1;
/*template_p=*/false);
gcc_assert (TYPE_P (type));
- if (! is_aggr_type (type, 1))
+ if (! is_class_type (type, 1))
return error_mark_node;
gcc_assert (DECL_P (member) || BASELINK_P (member));
(alloc_fn,
build_tree_list (NULL_TREE, class_addr)));
}
- else if (TYPE_FOR_JAVA (elt_type) && IS_AGGR_TYPE (elt_type))
+ else if (TYPE_FOR_JAVA (elt_type) && MAYBE_CLASS_TYPE_P (elt_type))
{
error ("Java class %q#T object allocated using placement new", elt_type);
return error_mark_node;
/* We should only have 1-D arrays here. */
gcc_assert (TREE_CODE (type) != ARRAY_TYPE);
- if (! IS_AGGR_TYPE (type) || TYPE_HAS_TRIVIAL_DESTRUCTOR (type))
+ if (! MAYBE_CLASS_TYPE_P (type) || TYPE_HAS_TRIVIAL_DESTRUCTOR (type))
goto no_destructor;
/* The below is short by the cookie size. */
num_initialized_elts++;
current_stmt_tree ()->stmts_are_full_exprs_p = 1;
- if (IS_AGGR_TYPE (type) || TREE_CODE (type) == ARRAY_TYPE)
+ if (MAYBE_CLASS_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE)
finish_expr_stmt (build_aggr_init (baseref, elt, 0));
else
finish_expr_stmt (build_modify_expr (baseref, NOP_EXPR,
complete_p = false;
}
}
- if (VOID_TYPE_P (type) || !complete_p || !IS_AGGR_TYPE (type))
+ if (VOID_TYPE_P (type) || !complete_p || !MAYBE_CLASS_TYPE_P (type))
/* Call the builtin operator delete. */
return build_builtin_delete_call (addr);
if (TREE_SIDE_EFFECTS (addr))
addr = convert_force (build_pointer_type (type), addr, 0);
}
- gcc_assert (IS_AGGR_TYPE (type));
+ gcc_assert (MAYBE_CLASS_TYPE_P (type));
if (TYPE_HAS_TRIVIAL_DESTRUCTOR (type))
{
tree t = make_node (code);
/* Create lang_type structure. */
- if (IS_AGGR_TYPE_CODE (code)
+ if (RECORD_OR_UNION_CODE_P (code)
|| code == BOUND_TEMPLATE_TEMPLATE_PARM)
{
struct lang_type *pi = GGC_CNEW (struct lang_type);
}
/* Set up some flags that give proper default behavior. */
- if (IS_AGGR_TYPE_CODE (code))
+ if (RECORD_OR_UNION_CODE_P (code))
{
struct c_fileinfo *finfo = get_fileinfo (input_filename);
SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, finfo->interface_unknown);
}
tree
-make_aggr_type (enum tree_code code)
+make_class_type (enum tree_code code)
{
tree t = cxx_make_type (code);
-
- if (IS_AGGR_TYPE_CODE (code))
- SET_IS_AGGR_TYPE (t, 1);
-
+ SET_CLASS_TYPE_P (t, 1);
return t;
}
/* Handle the hair of processing (but not expanding) inline functions.
Also manage function and variable name overloading.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
t = build3 (COND_EXPR, TREE_TYPE (t), cond, t,
cp_convert (TREE_TYPE (t), integer_zero_node));
}
- if (IS_AGGR_TYPE (TREE_TYPE (t)))
+ if (MAYBE_CLASS_TYPE_P (TREE_TYPE (t)))
t = build_cplus_new (TREE_TYPE (t), t);
finish_return_stmt (t);
}
{
tree ctor_name;
- gcc_assert (IS_AGGR_TYPE (type));
+ gcc_assert (MAYBE_CLASS_TYPE_P (type));
if (!name)
return false;
if (TREE_CODE (old) == TYPE_DECL && DECL_ARTIFICIAL (old))
{
tree t = TREE_TYPE (old);
- if (IS_AGGR_TYPE (t) && warn_shadow
+ if (MAYBE_CLASS_TYPE_P (t) && warn_shadow
&& (! DECL_IN_SYSTEM_HEADER (decl)
|| ! DECL_IN_SYSTEM_HEADER (old)))
warning (OPT_Wshadow, "%q#D hides constructor for %q#T", decl, t);
error ("%<%T::%D%> names destructor", scope, name);
return NULL_TREE;
}
- if (IS_AGGR_TYPE (scope) && constructor_name_p (name, scope))
+ if (MAYBE_CLASS_TYPE_P (scope) && constructor_name_p (name, scope))
{
error ("%<%T::%D%> names constructor", scope, name);
return NULL_TREE;
if (qualified_lookup_using_namespace (name, scope, &binding, flags))
t = binding.value;
}
- else if (is_aggr_type (scope, complain))
+ else if (is_class_type (scope, complain))
t = lookup_member (scope, name, 2, is_type_p);
if (!t)
;
else
{
- gcc_assert (IS_AGGR_TYPE (type) || TREE_CODE (type) == ENUMERAL_TYPE);
+ gcc_assert (MAYBE_CLASS_TYPE_P (type)
+ || TREE_CODE (type) == ENUMERAL_TYPE);
if (processing_template_decl)
{
}
else if (TREE_CODE (decl) != TYPE_DECL
|| TREE_TYPE (decl) == error_mark_node
- || !IS_AGGR_TYPE (TREE_TYPE (decl)))
+ || !MAYBE_CLASS_TYPE_P (TREE_TYPE (decl)))
decl = error_mark_node;
if (decl == error_mark_node)
type = TREE_TYPE (decl);
if (type == error_mark_node)
return error_mark_node;
- if (IS_AGGR_TYPE (type)
+ if (MAYBE_CLASS_TYPE_P (type)
&& CLASSTYPE_TEMPLATE_INFO (type)
&& !CLASSTYPE_TEMPLATE_SPECIALIZATION (type))
{
if (parm && TREE_CODE (parm) == TEMPLATE_DECL)
{
- t = make_aggr_type (TEMPLATE_TEMPLATE_PARM);
+ t = cxx_make_type (TEMPLATE_TEMPLATE_PARM);
/* This is for distinguishing between real templates and template
template parameters */
TREE_TYPE (parm) = t;
}
else
{
- t = make_aggr_type (TEMPLATE_TYPE_PARM);
+ t = cxx_make_type (TEMPLATE_TYPE_PARM);
/* parm is either IDENTIFIER_NODE or NULL_TREE. */
decl = build_decl (TYPE_DECL, parm, t);
}
if (template)
context = DECL_CONTEXT (template);
}
- else if (TREE_CODE (d1) == TYPE_DECL && IS_AGGR_TYPE (TREE_TYPE (d1)))
+ else if (TREE_CODE (d1) == TYPE_DECL && MAYBE_CLASS_TYPE_P (TREE_TYPE (d1)))
{
tree type = TREE_TYPE (d1);
}
}
else if (TREE_CODE (d1) == ENUMERAL_TYPE
- || (TYPE_P (d1) && IS_AGGR_TYPE (d1)))
+ || (TYPE_P (d1) && MAYBE_CLASS_TYPE_P (d1)))
{
template = TYPE_TI_TEMPLATE (d1);
d1 = DECL_NAME (template);
}
else
{
- t = make_aggr_type (TREE_CODE (template_type));
+ t = make_class_type (TREE_CODE (template_type));
CLASSTYPE_DECLARED_CLASS (t)
= CLASSTYPE_DECLARED_CLASS (template_type);
SET_CLASSTYPE_IMPLICIT_INSTANTIATION (t);
else
{
tree r = TREE_TYPE (TREE_VALUE (arg_types));
- if (! IS_AGGR_TYPE (r))
+ if (! MAYBE_CLASS_TYPE_P (r))
{
/* [temp.deduct]
case OFFSET_TYPE:
{
r = tsubst (TYPE_OFFSET_BASETYPE (t), args, complain, in_decl);
- if (r == error_mark_node || !IS_AGGR_TYPE (r))
+ if (r == error_mark_node || !MAYBE_CLASS_TYPE_P (r))
{
/* [temp.deduct]
if (ctx == error_mark_node || f == error_mark_node)
return error_mark_node;
- if (!IS_AGGR_TYPE (ctx))
+ if (!MAYBE_CLASS_TYPE_P (ctx))
{
if (complain & tf_error)
error ("%qT is not a class, struct, or union type", ctx);
/* We do not want to process the index of aggregate
initializers as they are identifier nodes which will be
looked up by digest_init. */
- process_index_p = !(type && IS_AGGR_TYPE (type));
+ process_index_p = !(type && MAYBE_CLASS_TYPE_P (type));
n = VEC_copy (constructor_elt, gc, CONSTRUCTOR_ELTS (t));
newlen = VEC_length (constructor_elt, n);
tree rval = NULL_TREE;
tree binfo;
- gcc_assert (IS_AGGR_TYPE_CODE (TREE_CODE (arg)));
+ gcc_assert (RECORD_OR_UNION_CODE_P (TREE_CODE (arg)));
binfo = TYPE_BINFO (complete_type (arg));
if (!binfo)
{
tree storage = *(tree *) data;
- if (IS_AGGR_TYPE (entry->type)
+ if (MAYBE_CLASS_TYPE_P (entry->type)
&& !uses_template_parms (CLASSTYPE_TI_ARGS (entry->type)))
do_type_instantiation (TYPE_MAIN_DECL (entry->type), storage, 0);
}
break;
/* Fall through. */
case REFERENCE_TYPE:
- if (! IS_AGGR_TYPE (TREE_TYPE (type)))
+ if (! MAYBE_CLASS_TYPE_P (TREE_TYPE (type)))
{
errstr = "target is not pointer or reference to class";
goto fail;
errstr = "source is not a pointer";
goto fail;
}
- if (! IS_AGGR_TYPE (TREE_TYPE (exprtype)))
+ if (! MAYBE_CLASS_TYPE_P (TREE_TYPE (exprtype)))
{
errstr = "source is not a pointer to class";
goto fail;
/* T is a reference type, v shall be an lvalue of a complete class
type, and the result is an lvalue of the type referred to by T. */
- if (! IS_AGGR_TYPE (TREE_TYPE (exprtype)))
+ if (! MAYBE_CLASS_TYPE_P (TREE_TYPE (exprtype)))
{
errstr = "source is not of class type";
goto fail;
}
/* Create the pseudo type. */
- pseudo_type = make_aggr_type (RECORD_TYPE);
+ pseudo_type = make_class_type (RECORD_TYPE);
finish_builtin_struct (pseudo_type, pseudo_name, fields, NULL_TREE);
CLASSTYPE_AS_BASE (pseudo_type) = pseudo_type;
fields = field;
ti = VEC_index (tinfo_s, tinfo_descs, TK_TYPE_INFO_TYPE);
- ti->type = make_aggr_type (RECORD_TYPE);
+ ti->type = make_class_type (RECORD_TYPE);
ti->vtable = NULL_TREE;
ti->name = NULL_TREE;
finish_builtin_struct (ti->type, "__type_info_pseudo",
ti = VEC_index (tinfo_s, tinfo_descs, TK_BASE_TYPE);
- ti->type = make_aggr_type (RECORD_TYPE);
+ ti->type = make_class_type (RECORD_TYPE);
ti->vtable = NULL_TREE;
ti->name = NULL_TREE;
finish_builtin_struct (ti->type, "__base_class_type_info_pseudo",
/* Breadth-first and depth-first routines for
searching multiple-inheritance lattice for GNU C++.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ 1999, 2000, 2002, 2003, 2004, 2005, 2007, 2008
+ Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
This file is part of GCC.
}
else
{
- if (!IS_AGGR_TYPE_CODE (TREE_CODE (xbasetype)))
+ if (!RECORD_OR_UNION_CODE_P (TREE_CODE (xbasetype)))
return NULL_TREE;
type = xbasetype;
xbasetype = NULL_TREE;
t = error_mark_node;
}
- if (t == error_mark_node || ! IS_AGGR_TYPE (t))
+ if (t == error_mark_node || ! MAYBE_CLASS_TYPE_P (t))
{
- t = make_aggr_type (RECORD_TYPE);
+ t = make_class_type (RECORD_TYPE);
pushtag (make_anon_name (), t, /*tag_scope=*/ts_current);
}
if (TYPE_BEING_DEFINED (t))
{
- t = make_aggr_type (TREE_CODE (t));
+ t = make_class_type (TREE_CODE (t));
pushtag (TYPE_IDENTIFIER (t), t, /*tag_scope=*/ts_current);
}
maybe_process_partial_specialization (t);
error ("invalid base-class specification");
result = NULL_TREE;
}
- else if (! is_aggr_type (base, 1))
- result = NULL_TREE;
+ else if (! MAYBE_CLASS_TYPE_P (base))
+ {
+ error ("%qT is not a class type", base);
+ result = NULL_TREE;
+ }
else
{
if (cp_type_quals (base) != 0)
if (type_dependent_expression_p (expr))
{
- type = make_aggr_type (TYPEOF_TYPE);
+ type = cxx_make_type (TYPEOF_TYPE);
TYPEOF_TYPE_EXPR (type) = expr;
SET_TYPE_STRUCTURAL_EQUALITY (type);
if (TREE_STATIC (decl))
{
tree ctx = CP_DECL_CONTEXT (decl);
- if (TYPE_P (ctx) && IS_AGGR_TYPE (ctx))
+ if (TYPE_P (ctx) && MAYBE_CLASS_TYPE_P (ctx))
return OMP_CLAUSE_DEFAULT_SHARED;
}
if (type_dependent_expression_p (expr))
{
- type = make_aggr_type (DECLTYPE_TYPE);
+ type = cxx_make_type (DECLTYPE_TYPE);
DECLTYPE_TYPE_EXPR (type) = expr;
DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (type)
= id_expression_or_member_access_p;
tree decl = TYPE_NAME (t);
tree t2;
- t2 = make_aggr_type (BOUND_TEMPLATE_TEMPLATE_PARM);
+ t2 = cxx_make_type (BOUND_TEMPLATE_TEMPLATE_PARM);
decl = build_decl (TYPE_DECL, DECL_NAME (decl), NULL_TREE);
/* These nodes have to be created to reflect new TYPE_DECL and template
;
else if (real_lvalue_p (arg))
type = build_reference_type (lvalue_type (arg));
- else if (IS_AGGR_TYPE (type))
+ else if (MAYBE_CLASS_TYPE_P (type))
type = lvalue_type (arg);
return type;
/* Build expressions with type checking for C++ compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
if (TREE_CODE (targ) == SAVE_EXPR)
targ = TREE_OPERAND (targ, 0);
- if (TREE_CODE (targ) == CALL_EXPR && IS_AGGR_TYPE (TREE_TYPE (targ)))
+ if (TREE_CODE (targ) == CALL_EXPR && MAYBE_CLASS_TYPE_P (TREE_TYPE (targ)))
{
if (TREE_CODE (arg) == SAVE_EXPR)
targ = arg;
TREE_SIDE_EFFECTS (result) = 1;
return result;
}
- else if (! IS_AGGR_TYPE (lhstype))
+ else if (! MAYBE_CLASS_TYPE_P (lhstype))
/* Do the default thing. */;
else
{
if (modifycode == NOP_EXPR)
{
/* `operator=' is not an inheritable operator. */
- if (! IS_AGGR_TYPE (lhstype))
+ if (! MAYBE_CLASS_TYPE_P (lhstype))
/* Do the default thing. */;
else
{
/* A binary op has been requested. Combine the old LHS
value with the RHS producing the value we should actually
store into the LHS. */
+ gcc_assert (!((TREE_CODE (lhstype) == REFERENCE_TYPE
+ && MAYBE_CLASS_TYPE_P (TREE_TYPE (lhstype)))
+ || MAYBE_CLASS_TYPE_P (lhstype)));
- gcc_assert (!PROMOTES_TO_AGGR_TYPE (lhstype, REFERENCE_TYPE));
lhs = stabilize_reference (lhs);
newrhs = cp_build_binary_op (modifycode, lhs, rhs);
if (newrhs == error_mark_node)
type = complete_type (type);
- if (IS_AGGR_TYPE (type))
+ if (MAYBE_CLASS_TYPE_P (type))
return ocp_convert (type, rhs, CONV_IMPLICIT|CONV_FORCE_TEMP, flags);
return convert_for_assignment (type, rhs, errtype, fndecl, parmnum);
/* Report error messages, build initializers, and perform
some front-end optimizations for C++ compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007
+ 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
if (TREE_CODE (type) == ERROR_MARK)
return NULL_TREE;
- if (IS_AGGR_TYPE (type))
+ if (MAYBE_CLASS_TYPE_P (type))
{
gcc_assert (TYPE_HAS_TRIVIAL_INIT_REF (type)
|| TREE_CODE (init) == CONSTRUCTOR);
we can't rely on the back end to do it for us, so build up
TARGET_EXPRs. If the type in question is a class, just build
one up; if it's an array, recurse. */
- if (IS_AGGR_TYPE (TREE_TYPE (type)))
+ if (MAYBE_CLASS_TYPE_P (TREE_TYPE (type)))
next = build_functional_cast (TREE_TYPE (type), NULL_TREE);
else
next = build_constructor (NULL_TREE, NULL);
default-initialization, we can't rely on the back end to do it
for us, so build up TARGET_EXPRs. If the type in question is
a class, just build one up; if it's an array, recurse. */
- if (IS_AGGR_TYPE (TREE_TYPE (field)))
+ if (MAYBE_CLASS_TYPE_P (TREE_TYPE (field)))
next = build_functional_cast (TREE_TYPE (field), NULL_TREE);
else
next = build_constructor (NULL_TREE, NULL);
expr = build_non_dependent_expr (expr);
}
- if (IS_AGGR_TYPE (type))
+ if (MAYBE_CLASS_TYPE_P (type))
{
while ((expr = build_new_op (COMPONENT_REF, LOOKUP_NORMAL, expr,
NULL_TREE, NULL_TREE,
}
objtype = TYPE_MAIN_VARIANT (TREE_TYPE (datum));
- if (! IS_AGGR_TYPE (objtype))
+ if (! MAYBE_CLASS_TYPE_P (objtype))
{
error ("cannot apply member pointer %qE to %qE, which is of "
"non-class type %qT",
return t;
}
- if (! IS_AGGR_TYPE (type))
+ if (! MAYBE_CLASS_TYPE_P (type))
{
if (parms == NULL_TREE)
return cp_convert (type, integer_zero_node);