aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorPaolo Carlini <pcarlini@suse.de>2008-03-21 18:56:51 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2008-03-21 18:56:51 +0000
commit9e1e64ec2b978e81924000db7d4009b92bb5a638 (patch)
tree28e5155485b87e7675ad708f94b5a26a8e4ea948 /gcc/cp/decl.c
parentfc34570cc14662c34807b275ea7dd5c8ac310e9f (diff)
downloadgcc-9e1e64ec2b978e81924000db7d4009b92bb5a638.zip
gcc-9e1e64ec2b978e81924000db7d4009b92bb5a638.tar.gz
gcc-9e1e64ec2b978e81924000db7d4009b92bb5a638.tar.bz2
cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
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. From-SVN: r133434
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 2318f69..8353b9b 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2891,7 +2891,7 @@ build_typename_type (tree context, tree name, tree fullname,
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;
@@ -2979,7 +2979,7 @@ make_typename_type (tree context, tree name, enum tag_types tag_type,
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);
@@ -3056,7 +3056,7 @@ make_unbound_class_template (tree context, tree name, tree parm_list,
{
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))
@@ -3084,7 +3084,7 @@ make_unbound_class_template (tree context, tree name, tree parm_list,
}
/* 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);
@@ -3382,7 +3382,7 @@ cxx_init_decl_processing (void)
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);
@@ -3773,7 +3773,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
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)
@@ -3781,7 +3781,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
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
@@ -3910,7 +3910,7 @@ groktypename (cp_decl_specifier_seq *type_specifiers,
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);
@@ -4174,7 +4174,7 @@ start_decl_1 (tree decl, bool initialized)
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.
@@ -4427,7 +4427,7 @@ layout_var_decl (tree decl)
/* 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);
@@ -5054,7 +5054,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup)
;
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);
@@ -5450,7 +5450,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
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);
@@ -5504,7 +5504,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
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"));
@@ -5589,7 +5589,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
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
@@ -6854,13 +6854,13 @@ build_ptrmemfunc_type (tree type)
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;
@@ -9383,7 +9383,7 @@ grokparms (cp_parameter_declarator *first_parm, tree *parms)
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;
@@ -9831,10 +9831,11 @@ grok_op_properties (tree decl, bool complain)
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;
}
@@ -9875,7 +9876,7 @@ grok_op_properties (tree decl, bool complain)
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";
@@ -10349,14 +10350,14 @@ xref_tag (enum tag_types tag_code, tree name,
}
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);
@@ -10983,7 +10984,7 @@ check_function_type (tree decl, tree current_function_parms)
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);