diff options
author | Ian Lance Taylor <iant@google.com> | 2009-04-25 22:28:57 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2009-04-25 22:28:57 +0000 |
commit | cff9d94dfd001fb1348f2790722e6e660a3a81a9 (patch) | |
tree | 79e16a4773260a0f8f545460deb518ee74752bad | |
parent | 70b3030cd98456ec8a9317bc3c8bc172d96bd277 (diff) |
* cp/cp-tree.h (enum cp_lvalue_kind_enum): Rename from
cp_lvalue_kind.
(cp_lvalue_kind): Typedef to int, not enum type.
(enum tsubst_flags): Rename from enum tsubst_flags_t.
(tsubst_flags_t): Typedef to int, not enum type.
(enum base_access_enum): Rename from enum base_access.
(base_access): Typedef to int, not enum type.
* cp/parser.c (enum cp_parser_flags_enum): Rename from
cp_parser_flags.
(cp_parser_flags): Typedef to int, not enum type.
* cp/call.c: Revert the 2008-09-10 changes to change
tsubst_flags_t, base_access, and cp_lvalue_kind to int.
* cp/class.c: Likewise.
* cp/cp-lang.c: Likewise.
* cp/cp-objcp-common.h: Likewise.
* cp/cvt.c: Likewise.
* cp/decl.c: Likewise.
* cp/init.c: Likewise.
* cp/pt.c: Likewise.
* cp/rtti.c: Likewise.
* cp/search.c: Likewise.
* cp/semantics.c: Likewise.
* cp/tree.c: Likewise.
* cp/typeck.c: Likewise.
* cp/typeck2.c: Likewise.
* cp/parser.c: Likewise.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-in-cxx@146788 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.cxx | 29 | ||||
-rw-r--r-- | gcc/cp/call.c | 33 | ||||
-rw-r--r-- | gcc/cp/class.c | 6 | ||||
-rw-r--r-- | gcc/cp/cp-lang.c | 2 | ||||
-rw-r--r-- | gcc/cp/cp-objcp-common.h | 3 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 129 | ||||
-rw-r--r-- | gcc/cp/cvt.c | 2 | ||||
-rw-r--r-- | gcc/cp/decl.c | 4 | ||||
-rw-r--r-- | gcc/cp/init.c | 16 | ||||
-rw-r--r-- | gcc/cp/parser.c | 20 | ||||
-rw-r--r-- | gcc/cp/pt.c | 102 | ||||
-rw-r--r-- | gcc/cp/rtti.c | 6 | ||||
-rw-r--r-- | gcc/cp/search.c | 2 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 2 | ||||
-rw-r--r-- | gcc/cp/tree.c | 12 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 63 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 2 |
17 files changed, 249 insertions, 184 deletions
diff --git a/gcc/ChangeLog.cxx b/gcc/ChangeLog.cxx index 0672ecda62f..247b6cb42de 100644 --- a/gcc/ChangeLog.cxx +++ b/gcc/ChangeLog.cxx @@ -1,3 +1,32 @@ +2009-04-25 Ian Lance Taylor <iant@google.com> + + * cp/cp-tree.h (enum cp_lvalue_kind_enum): Rename from + cp_lvalue_kind. + (cp_lvalue_kind): Typedef to int, not enum type. + (enum tsubst_flags): Rename from enum tsubst_flags_t. + (tsubst_flags_t): Typedef to int, not enum type. + (enum base_access_enum): Rename from enum base_access. + (base_access): Typedef to int, not enum type. + * cp/parser.c (enum cp_parser_flags_enum): Rename from + cp_parser_flags. + (cp_parser_flags): Typedef to int, not enum type. + * cp/call.c: Revert the 2008-09-10 changes to change + tsubst_flags_t, base_access, and cp_lvalue_kind to int. + * cp/class.c: Likewise. + * cp/cp-lang.c: Likewise. + * cp/cp-objcp-common.h: Likewise. + * cp/cvt.c: Likewise. + * cp/decl.c: Likewise. + * cp/init.c: Likewise. + * cp/pt.c: Likewise. + * cp/rtti.c: Likewise. + * cp/search.c: Likewise. + * cp/semantics.c: Likewise. + * cp/tree.c: Likewise. + * cp/typeck.c: Likewise. + * cp/typeck2.c: Likewise. + * cp/parser.c: Likewise. + 2009-03-25 Jerry Quinn <jlquinn@cerberus.qb5.org> * config/i386/i386.c (ix86_function_specific_save): Don't check diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 35a9f6a5c16..f0c393a024b 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -131,7 +131,7 @@ static struct z_candidate * tourney (struct z_candidate *); static int equal_functions (tree, tree); static int joust (struct z_candidate *, struct z_candidate *, bool); static int compare_ics (conversion *, conversion *); -static tree build_over_call (struct z_candidate *, int, int); +static tree build_over_call (struct z_candidate *, int, tsubst_flags_t); static tree build_java_interface_fn_ref (tree, tree); #define convert_like(CONV, EXPR, COMPLAIN) \ convert_like_real ((CONV), (EXPR), NULL_TREE, 0, 0, \ @@ -142,10 +142,10 @@ static tree build_java_interface_fn_ref (tree, tree); /*issue_conversion_warnings=*/true, \ /*c_cast_p=*/false, (COMPLAIN)) static tree convert_like_real (conversion *, tree, tree, int, int, bool, - bool, int); + bool, tsubst_flags_t); static void op_error (enum tree_code, enum tree_code, tree, tree, tree, const char *); -static tree build_object_call (tree, tree, int); +static tree build_object_call (tree, tree, tsubst_flags_t); static tree resolve_args (tree); static struct z_candidate *build_user_type_conversion_1 (tree, tree, int); static void print_z_candidate (const char *, struct z_candidate *); @@ -706,7 +706,7 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p, if ((TYPE_PTRFN_P (to) || TYPE_PTRMEMFUNC_P (to)) && expr && type_unknown_p (expr)) { - int tflags = tf_conv; + tsubst_flags_t tflags = tf_conv; if (!(flags & LOOKUP_PROTECT)) tflags |= tf_no_access_control; expr = instantiate_type (to, expr, tflags); @@ -1195,7 +1195,7 @@ reference_binding (tree rto, tree rfrom, tree expr, bool c_cast_p, int flags) tree tfrom; bool related_p; bool compatible_p; - int lvalue_p = clk_none; + cp_lvalue_kind lvalue_p = clk_none; if (TREE_CODE (to) == FUNCTION_TYPE && expr && type_unknown_p (expr)) { @@ -2985,7 +2985,7 @@ perform_overload_resolution (tree fn, tree build_new_function_call (tree fn, tree args, bool koenig_p, - int complain) + tsubst_flags_t complain) { struct z_candidate *candidates, *cand; bool any_viable_p; @@ -3153,7 +3153,7 @@ build_operator_new_call (tree fnname, tree args, } static tree -build_object_call (tree obj, tree args, int complain) +build_object_call (tree obj, tree args, tsubst_flags_t complain) { struct z_candidate *candidates = 0, *cand; tree fns, convs, mem_args = NULL_TREE; @@ -3393,7 +3393,8 @@ conditional_conversion (tree e1, tree e2) arguments to the conditional expression. */ tree -build_conditional_expr (tree arg1, tree arg2, tree arg3, int complain) +build_conditional_expr (tree arg1, tree arg2, tree arg3, + tsubst_flags_t complain) { tree arg2_type; tree arg3_type; @@ -3888,7 +3889,7 @@ add_candidates (tree fns, tree args, tree build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, - bool *overloaded_p, int complain) + bool *overloaded_p, tsubst_flags_t complain) { struct z_candidate *candidates = 0, *cand; tree arglist, fnname; @@ -4508,7 +4509,7 @@ conversion_null_warnings (tree totype, tree expr, tree fn, int argnum) static tree convert_like_real (conversion *convs, tree expr, tree fn, int argnum, int inner, bool issue_conversion_warnings, - bool c_cast_p, int complain) + bool c_cast_p, tsubst_flags_t complain) { tree totype = convs->type; diagnostic_t diag_kind; @@ -4721,7 +4722,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, || TREE_CODE (expr) == VA_ARG_EXPR) { tree type = convs->u.next->type; - int lvalue = real_lvalue_p (expr); + cp_lvalue_kind lvalue = real_lvalue_p (expr); if (!CP_TYPE_CONST_NON_VOLATILE_P (TREE_TYPE (ref_type)) && !TYPE_REF_IS_RVALUE (ref_type)) @@ -5099,7 +5100,7 @@ magic_varargs_p (tree fn) bitmask of various LOOKUP_* flags which apply to the call itself. */ static tree -build_over_call (struct z_candidate *cand, int flags, int complain) +build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) { tree fn = cand->fn; tree args = cand->args; @@ -5582,7 +5583,7 @@ in_charge_arg_for_name (tree name) tree build_special_member_call (tree instance, tree name, tree args, - tree binfo, int flags, int complain) + tree binfo, int flags, tsubst_flags_t complain) { tree fns; /* The type of the subobject to be constructed or destroyed. */ @@ -5727,7 +5728,7 @@ name_as_c_string (tree name, tree type, bool *free_p) tree build_new_method_call (tree instance, tree fns, tree args, tree conversion_path, int flags, - tree *fn_p, int complain) + tree *fn_p, tsubst_flags_t complain) { struct z_candidate *candidates = 0, *cand; tree explicit_targs = NULL_TREE; @@ -6944,7 +6945,7 @@ can_convert_arg_bad (tree to, tree from, tree arg) doing a bad conversion, convert_like will complain. */ tree -perform_implicit_conversion (tree type, tree expr, int complain) +perform_implicit_conversion (tree type, tree expr, tsubst_flags_t complain) { conversion *conv; void *p; @@ -6993,7 +6994,7 @@ tree perform_direct_initialization_if_possible (tree type, tree expr, bool c_cast_p, - int complain) + tsubst_flags_t complain) { conversion *conv; void *p; diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 1da659ef604..d56abd4d033 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -5940,7 +5940,7 @@ pop_lang_context (void) static tree resolve_address_of_overloaded_function (tree target_type, tree overload, - int flags, + tsubst_flags_t flags, bool template_only, tree explicit_targs, tree access_path) @@ -6236,9 +6236,9 @@ resolve_address_of_overloaded_function (tree target_type, function, or a pointer to member function. */ tree -instantiate_type (tree lhstype, tree rhs, int flags) +instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) { - int flags_in = flags; + tsubst_flags_t flags_in = flags; tree access_path = NULL_TREE; flags &= ~tf_ptrmem_ok; diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index c49a5286363..c8fa77c2099 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -69,7 +69,7 @@ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; tree objcp_tsubst_copy_and_build (tree t ATTRIBUTE_UNUSED, tree args ATTRIBUTE_UNUSED, - int complain ATTRIBUTE_UNUSED, + tsubst_flags_t complain ATTRIBUTE_UNUSED, tree in_decl ATTRIBUTE_UNUSED, bool function_p ATTRIBUTE_UNUSED) { diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h index 4a3dac12297..f24107598aa 100644 --- a/gcc/cp/cp-objcp-common.h +++ b/gcc/cp/cp-objcp-common.h @@ -23,7 +23,8 @@ along with GCC; see the file COPYING3. If not see /* In cp/cp-lang.c and objcp/objcp-lang.c. */ -extern tree objcp_tsubst_copy_and_build (tree, tree, int, tree, bool); +extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t, + tree, bool); /* Lang hooks that are shared between C++ and ObjC++ are defined here. Hooks specific to C++ or ObjC++ go in cp/cp-lang.c and objcp/objcp-lang.c, diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 9caf24c58d9..40d21462a23 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -3485,13 +3485,17 @@ enum tag_types { }; /* The various kinds of lvalues we distinguish. */ -typedef enum cp_lvalue_kind { +enum cp_lvalue_kind_enum { clk_none = 0, /* Things that are not an lvalue. */ clk_ordinary = 1, /* An ordinary lvalue. */ clk_class = 2, /* An rvalue of class-type. */ clk_bitfield = 4, /* An lvalue for a bit-field. */ clk_packed = 8 /* An lvalue for a packed field. */ -} cp_lvalue_kind; +}; + +/* This type is used for parameters and variables which hold + combinations of the flags in enum cp_lvalue_kind. */ +typedef int cp_lvalue_kind; /* Various kinds of template specialization, instantiation, etc. */ typedef enum tmpl_spec_kind { @@ -3564,7 +3568,7 @@ typedef enum linkage_kind { } linkage_kind; /* Bitmask flags to control type substitution. */ -typedef enum tsubst_flags_t { +enum tsubst_flags { tf_none = 0, /* nothing special */ tf_error = 1 << 0, /* give error messages */ tf_warning = 1 << 1, /* give warnings too */ @@ -3583,10 +3587,14 @@ typedef enum tsubst_flags_t { when issuing other errors. */ /* Convenient substitution flags combinations. */ tf_warning_or_error = tf_warning | tf_error -} tsubst_flags_t; +}; + +/* This type is used for parameters and variables which hold + combinations of the flags in enum tsubst_flags. */ +typedef int tsubst_flags_t; /* The kind of checking we can do looking in a class hierarchy. */ -typedef enum base_access { +enum base_access_enum { ba_any = 0, /* Do not check access, allow an ambiguous base, prefer a non-virtual base */ ba_unique = 1 << 0, /* Must be a unique base. */ @@ -3594,7 +3602,11 @@ typedef enum base_access { ba_check = ba_unique | ba_check_bit, ba_ignore_scope = 1 << 2, /* Ignore access allowed by local scope. */ ba_quiet = 1 << 3 /* Do not issue error messages. */ -} base_access; +}; + +/* This type is used for parameters and variables which hold + combinations of the flags in enum base_access. */ +typedef int base_access; /* The various kinds of access check during parsing. */ typedef enum deferring_kind { @@ -4175,7 +4187,8 @@ extern cp_parameter_declarator *no_parameters; extern bool check_dtor_name (tree, tree); extern tree build_vfield_ref (tree, tree); -extern tree build_conditional_expr (tree, tree, tree, int); +extern tree build_conditional_expr (tree, tree, tree, + tsubst_flags_t); extern tree build_addr_func (tree); extern tree build_call_a (tree, int, tree*); extern tree build_call_n (tree, int, ...); @@ -4183,16 +4196,17 @@ extern bool null_ptr_cst_p (tree); extern bool sufficient_parms_p (const_tree); extern tree type_decays_to (tree); extern tree build_user_type_conversion (tree, tree, int); -extern tree build_new_function_call (tree, tree, bool, int); +extern tree build_new_function_call (tree, tree, bool, + tsubst_flags_t); extern tree build_operator_new_call (tree, tree, tree *, tree *, tree *); extern tree build_new_method_call (tree, tree, tree, tree, int, - tree *, int); + tree *, tsubst_flags_t); extern tree build_special_member_call (tree, tree, tree, tree, int, - int); + tsubst_flags_t); extern tree build_new_op (enum tree_code, int, tree, tree, tree, bool *, - int); + tsubst_flags_t); extern tree build_op_delete_call (enum tree_code, tree, tree, bool, tree, tree); extern bool can_convert (tree, tree); extern bool can_convert_arg (tree, tree, tree, int); @@ -4209,9 +4223,9 @@ extern tree set_up_extended_ref_temp (tree, tree, tree *, tree *); extern tree initialize_reference (tree, tree, tree, tree *); extern tree make_temporary_var_for_ref_to_temp (tree, tree); extern tree strip_top_quals (tree); -extern tree perform_implicit_conversion (tree, tree, int); +extern tree perform_implicit_conversion (tree, tree, tsubst_flags_t); extern tree perform_direct_initialization_if_possible (tree, tree, bool, - int); + tsubst_flags_t); extern tree in_charge_arg_for_name (tree); extern tree build_cxx_call (tree, int, tree *); extern bool is_std_init_list (tree); @@ -4245,7 +4259,7 @@ extern void pop_nested_class (void); extern int current_lang_depth (void); extern void push_lang_context (tree); extern void pop_lang_context (void); -extern tree instantiate_type (tree, tree, int); +extern tree instantiate_type (tree, tree, tsubst_flags_t); extern void print_class_statistics (void); extern void cxx_print_statistics (void); extern void cxx_print_xnode (FILE *, tree, int); @@ -4284,7 +4298,7 @@ extern tree ocp_convert (tree, tree, int, int); extern tree cp_convert (tree, tree); extern tree cp_convert_and_check (tree, tree); extern tree convert_to_void (tree, const char */*implicit context*/, - int); + tsubst_flags_t); extern tree convert_force (tree, tree, int); extern tree build_expr_type_conversion (int, tree, bool); extern tree type_promotes_to (tree); @@ -4315,9 +4329,8 @@ extern tree declare_local_label (tree); extern tree define_label (location_t, tree); extern void check_goto (tree); extern bool check_omp_return (void); -extern tree make_typename_type (tree, tree, enum tag_types, - int); -extern tree make_unbound_class_template (tree, tree, tree, int); +extern tree make_typename_type (tree, tree, enum tag_types, tsubst_flags_t); +extern tree make_unbound_class_template (tree, tree, tree, tsubst_flags_t); extern tree check_for_out_of_scope_variable (tree); extern tree build_library_fn_ptr (const char *, tree); extern tree build_cp_library_fn_ptr (const char *, tree); @@ -4470,7 +4483,8 @@ extern tree do_friend (tree, tree, tree, tree, enum overload_flags, bool); /* in init.c */ extern tree expand_member_init (tree); extern void emit_mem_initializers (tree); -extern tree build_aggr_init (tree, tree, int, int); +extern tree build_aggr_init (tree, tree, int, + tsubst_flags_t); extern int is_class_type (tree, int); extern tree get_type_value (tree); extern tree build_zero_init (tree, tree, bool); @@ -4478,9 +4492,9 @@ extern tree build_value_init (tree); extern tree build_value_init_noctor (tree); extern tree build_offset_ref (tree, tree, bool); extern tree build_new (tree, tree, tree, tree, int, - int); + tsubst_flags_t); extern tree build_vec_init (tree, tree, tree, bool, int, - int); + tsubst_flags_t); extern tree build_delete (tree, tree, special_function_kind, int, int); @@ -4554,18 +4568,18 @@ extern tree push_template_decl (tree); extern tree push_template_decl_real (tree, bool); extern bool redeclare_class_template (tree, tree); extern tree lookup_template_class (tree, tree, tree, tree, - int, int); + int, tsubst_flags_t); extern tree lookup_template_function (tree, tree); extern int uses_template_parms (tree); extern int uses_template_parms_level (tree, int); extern tree instantiate_class_template (tree); -extern tree instantiate_template (tree, tree, int); +extern tree instantiate_template (tree, tree, tsubst_flags_t); extern int fn_type_unification (tree, tree, tree, tree, tree, unification_kind_t, int); extern void mark_decl_instantiated (tree, int); extern int more_specialized_fn (tree, tree, int); extern void do_decl_instantiation (tree, tree); -extern void do_type_instantiation (tree, tree, int); +extern void do_type_instantiation (tree, tree, tsubst_flags_t); extern tree instantiate_decl (tree, int, bool); extern int comp_template_parms (const_tree, const_tree); extern bool uses_parameter_packs (tree); @@ -4582,7 +4596,7 @@ extern tree most_specialized_instantiation (tree); extern void print_candidates (tree); extern void instantiate_pending_templates (int); extern tree tsubst_default_argument (tree, tree, tree); -extern tree tsubst_copy_and_build (tree, tree, int, +extern tree tsubst_copy_and_build (tree, tree, tsubst_flags_t, tree, bool, bool); extern tree most_general_template (tree); extern tree get_mostly_instantiated_function_type (tree); @@ -4625,13 +4639,14 @@ extern tree build_typeid (tree); extern tree get_tinfo_decl (tree); extern tree get_typeid (tree); extern tree build_headof (tree); -extern tree build_dynamic_cast (tree, tree, int); +extern tree build_dynamic_cast (tree, tree, tsubst_flags_t); extern void emit_support_tinfos (void); extern bool emit_tinfo_decl (tree); /* in search.c */ extern bool accessible_base_p (tree, tree, bool); -extern tree lookup_base (tree, tree, int, base_kind *); +extern tree lookup_base (tree, tree, base_access, + base_kind *); extern tree dcast_base_hint (tree, tree); extern int accessible_p (tree, tree, bool); extern tree lookup_field_1 (tree, tree, bool); @@ -4755,7 +4770,8 @@ extern tree finish_stmt_expr_expr (tree, tree); extern tree finish_stmt_expr (tree, bool); extern tree stmt_expr_value_expr (tree); extern tree perform_koenig_lookup (tree, tree); -extern tree finish_call_expr (tree, tree, bool, int, int); +extern tree finish_call_expr (tree, tree, bool, int, + tsubst_flags_t); extern tree finish_increment_expr (tree, enum tree_code); extern tree finish_this_expr (void); extern tree finish_pseudo_destructor_expr (tree, tree, tree); @@ -4839,7 +4855,7 @@ extern tree canonical_type_variant (tree); extern tree copy_binfo (tree, tree, tree, tree *, int); extern int member_p (const_tree); -extern int real_lvalue_p (tree); +extern cp_lvalue_kind real_lvalue_p (tree); extern bool builtin_valid_in_constant_expr_p (const_tree); extern tree build_min (enum tree_code, tree, ...); extern tree build_min_nt (enum tree_code, ...); @@ -4880,7 +4896,7 @@ extern const struct attribute_spec cxx_attribute_table[]; extern tree make_ptrmem_cst (tree, tree); extern tree cp_build_type_attribute_variant (tree, tree); extern tree cp_build_reference_type (tree, bool); -extern tree cp_build_qualified_type_real (tree, int, int); +extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t); #define cp_build_qualified_type(TYPE, QUALS) \ cp_build_qualified_type_real ((TYPE), (QUALS), tf_warning_or_error) extern special_function_kind special_function_p (const_tree); @@ -4920,40 +4936,45 @@ extern tree cxx_sizeof_nowarn (tree); extern tree is_bitfield_expr_with_lowered_type (const_tree); extern tree unlowered_expr_type (const_tree); extern tree decay_conversion (tree); -extern tree build_class_member_access_expr (tree, tree, tree, bool, int); -extern tree finish_class_member_access_expr (tree, tree, bool, int); +extern tree build_class_member_access_expr (tree, tree, tree, bool, + tsubst_flags_t); +extern tree finish_class_member_access_expr (tree, tree, bool, + tsubst_flags_t); extern tree build_x_indirect_ref (tree, const char *, - int); -extern tree cp_build_indirect_ref (tree, const char *, int); + tsubst_flags_t); +extern tree cp_build_indirect_ref (tree, const char *, + tsubst_flags_t); extern tree build_array_ref (tree, tree, location_t); extern tree get_member_function_from_ptrfunc (tree *, tree); -extern tree cp_build_function_call (tree, tree, int); +extern tree cp_build_function_call (tree, tree, tsubst_flags_t); extern tree build_x_binary_op (enum tree_code, tree, enum tree_code, tree, enum tree_code, bool *, - int); -extern tree build_x_array_ref (tree, tree, int); -extern tree build_x_unary_op (enum tree_code, tree, int); + tsubst_flags_t); +extern tree build_x_array_ref (tree, tree, tsubst_flags_t); +extern tree build_x_unary_op (enum tree_code, tree, + tsubst_flags_t); extern tree cp_build_unary_op (enum tree_code, tree, int, - int); + tsubst_flags_t); extern tree unary_complex_lvalue (enum tree_code, tree); -extern tree build_x_conditional_expr (tree, tree, tree, int); +extern tree build_x_conditional_expr (tree, tree, tree, + tsubst_flags_t); extern tree build_x_compound_expr_from_list (tree, const char *); -extern tree build_x_compound_expr (tree, tree, int); +extern tree build_x_compound_expr (tree, tree, tsubst_flags_t); extern tree build_compound_expr (tree, tree); -extern tree cp_build_compound_expr (tree, tree, int); -extern tree build_static_cast (tree, tree, int); -extern tree build_reinterpret_cast (tree, tree, int); -extern tree build_const_cast (tree, tree, int); +extern tree cp_build_compound_expr (tree, tree, tsubst_flags_t); +extern tree build_static_cast (tree, tree, tsubst_flags_t); +extern tree build_reinterpret_cast (tree, tree, tsubst_flags_t); +extern tree build_const_cast (tree, tree, tsubst_flags_t); extern tree build_c_cast (tree, tree); -extern tree cp_build_c_cast (tree, tree, int); +extern tree cp_build_c_cast (tree, tree, tsubst_flags_t); extern tree build_x_modify_expr (tree, enum tree_code, tree, - int); + tsubst_flags_t); extern tree cp_build_modify_expr (tree, enum tree_code, tree, - int); + tsubst_flags_t); extern tree convert_for_initialization (tree, tree, tree, int, const char *, tree, int, - int); + tsubst_flags_t); extern int comp_ptr_ttypes (tree, tree); extern bool comp_ptr_ttypes_const (tree, tree); extern int ptr_reasonably_similar (const_tree, const_tree); @@ -4968,23 +4989,23 @@ extern void expand_ptrmemfunc_cst (tree, tree *, tree *); extern tree type_after_usual_arithmetic_conversions (tree, tree); extern tree common_pointer_type (tree, tree); extern tree composite_pointer_type (tree, tree, tree, tree, - const char*, int); + const char*, tsubst_flags_t); extern tree merge_types (tree, tree); extern tree check_return_expr (tree, bool *); extern tree cp_build_binary_op (location_t, enum tree_code, tree, tree, - int); + tsubst_flags_t); #define cxx_sizeof(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, true) extern tree build_ptrmemfunc_access_expr (tree, tree); extern tree build_address (tree); extern tree build_nop (tree, tree); extern tree non_reference (tree); extern tree lookup_anon_field (tree, tree); -extern bool invalid_nonstatic_memfn_p (const_tree, int); +extern bool invalid_nonstatic_memfn_p (const_tree, tsubst_flags_t); extern tree convert_member_func_to_ptr (tree, tree); extern tree convert_ptrmem (tree, tree, bool, bool); extern int lvalue_or_else (tree, enum lvalue_use, - int); + tsubst_flags_t); extern int lvalue_p (tree); /* in typeck2.c */ @@ -5006,7 +5027,7 @@ extern tree digest_init (tree, tree); extern tree build_scoped_ref (tree, tree, tree *); extern tree build_x_arrow (tree); extern tree build_m_component_ref (tree, tree); -extern tree build_functional_cast (tree, tree, int); +extern tree build_functional_cast (tree, tree, tsubst_flags_t); extern tree add_exception_specifier (tree, tree, int); extern tree merge_exception_specifiers (tree, tree); diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index f9f47c81684..abe062013ad 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -783,7 +783,7 @@ ocp_convert (tree type, tree expr, int convtype, int flags) IMPLICIT is tells us the context of an implicit void conversion. */ tree -convert_to_void (tree expr, const char *implicit, int complain) +convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain) { if (expr == error_mark_node || TREE_TYPE (expr) == error_mark_node) diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 428b817ea23..8097e1aefd2 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2930,7 +2930,7 @@ build_typename_type (tree context, tree name, tree fullname, tree make_typename_type (tree context, tree name, enum tag_types tag_type, - int complain) + tsubst_flags_t complain) { tree fullname; tree t; @@ -3044,7 +3044,7 @@ make_typename_type (tree context, tree name, enum tag_types tag_type, tree make_unbound_class_template (tree context, tree name, tree parm_list, - int complain) + tsubst_flags_t complain) { tree t; tree d; diff --git a/gcc/cp/init.c b/gcc/cp/init.c index f809e606018..85c496bbaf2 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -39,8 +39,8 @@ along with GCC; see the file COPYING3. If not see static bool begin_init_stmts (tree *, tree *); static tree finish_init_stmts (bool, tree, tree); static void construct_virtual_base (tree, tree); -static void expand_aggr_init_1 (tree, tree, tree, tree, int, int); -static void expand_default_init (tree, tree, tree, tree, int, int); +static void expand_aggr_init_1 (tree, tree, tree, tree, int, tsubst_flags_t); +static void expand_default_init (tree, tree, tree, tree, int, tsubst_flags_t); static tree build_vec_delete_1 (tree, tree, tree, special_function_kind, int); static void perform_member_init (tree, tree); static tree build_builtin_delete_call (tree); @@ -1204,7 +1204,7 @@ expand_member_init (tree name) perform the initialization, but not both, as it would be ambiguous. */ tree -build_aggr_init (tree exp, tree init, int flags, int complain) +build_aggr_init (tree exp, tree init, int flags, tsubst_flags_t complain) { tree stmt_expr; tree compound_stmt; @@ -1274,7 +1274,7 @@ build_aggr_init (tree exp, tree init, int flags, int complain) static void expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags, - int complain) + tsubst_flags_t complain) { tree type = TREE_TYPE (exp); tree ctor_name; @@ -1369,7 +1369,7 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags, static void expand_aggr_init_1 (tree binfo, tree true_exp, tree exp, tree init, int flags, - int complain) + tsubst_flags_t complain) { tree type = TREE_TYPE (exp); @@ -1781,7 +1781,7 @@ avoid_placement_new_aliasing (tree t, tree placement) static tree build_new_1 (tree placement, tree type, tree nelts, tree init, - bool globally_qualified_p, int complain) + bool globally_qualified_p, tsubst_flags_t complain) { tree size, rval; /* True iff this is a call to "operator new[]" instead of just @@ -2347,7 +2347,7 @@ build_new_1 (tree placement, tree type, tree nelts, tree init, tree build_new (tree placement, tree type, tree nelts, tree init, - int use_global_new, int complain) + int use_global_new, tsubst_flags_t complain) { tree rval; tree orig_placement; @@ -2685,7 +2685,7 @@ get_temp_regvar (tree type, tree init) tree build_vec_init (tree base, tree maxindex, tree init, bool explicit_value_init_p, - int from_array, int complain) + int from_array, tsubst_flags_t complain) { tree rval; tree base2 = NULL_TREE; diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index d7cf81233e8..2e758e93561 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -1193,7 +1193,7 @@ function_declarator_p (const cp_declarator *declarator) /* Flags that are passed to some parsing functions. These values can be bitwise-ored together. */ -typedef enum cp_parser_flags +enum cp_parser_flags_enum { /* No flags. */ CP_PARSER_FLAGS_NONE = 0x0, @@ -1202,7 +1202,11 @@ typedef enum cp_parser_flags CP_PARSER_FLAGS_OPTIONAL = 0x1, /* When parsing a type-specifier, do not allow user-defined types. */ CP_PARSER_FLAGS_NO_USER_DEFINED_TYPES = 0x2 -} cp_parser_flags; +}; + +/* This type is used for parameters and variables which hold + combinations of the flags in enum cp_parser_flags. */ +typedef int cp_parser_flags; /* The different kinds of declarators we want to parse. */ @@ -1672,16 +1676,16 @@ static void cp_parser_block_declaration static void cp_parser_simple_declaration (cp_parser *, bool); static void cp_parser_decl_specifier_seq - (cp_parser *, int, cp_decl_specifier_seq *, int *); + (cp_parser *, cp_parser_flags, cp_decl_specifier_seq *, int *); static tree cp_parser_storage_class_specifier_opt (cp_parser *); static tree cp_parser_function_specifier_opt (cp_parser *, cp_decl_specifier_seq *); static tree cp_parser_type_specifier - (cp_parser *, int, cp_decl_specifier_seq *, bool, + (cp_parser *, cp_parser_flags, cp_decl_specifier_seq *, bool, int *, bool *); static tree cp_parser_simple_type_specifier - (cp_parser *, cp_decl_specifier_seq *, int); + (cp_parser *, cp_decl_specifier_seq *, cp_parser_flags); static tree cp_parser_type_name (cp_parser *); static tree cp_parser_nonclass_name @@ -8360,7 +8364,7 @@ cp_parser_simple_declaration (cp_parser* parser, static void cp_parser_decl_specifier_seq (cp_parser* parser, - int flags, + cp_parser_flags flags, cp_decl_specifier_seq *decl_specs, int* declares_class_or_enum) { @@ -11148,7 +11152,7 @@ cp_parser_type_specifier (cp_parser* parser, static tree cp_parser_simple_type_specifier (cp_parser* parser, cp_decl_specifier_seq *decl_specs, - int flags) + cp_parser_flags flags) { tree type = NULL_TREE; cp_token *token; @@ -13824,7 +13828,7 @@ cp_parser_type_specifier_seq (cp_parser* parser, cp_decl_specifier_seq *type_specifier_seq) { bool seen_type_specifier = false; - int flags = CP_PARSER_FLAGS_OPTIONAL; + cp_parser_flags flags = CP_PARSER_FLAGS_OPTIONAL; cp_token *start_token = NULL; /* Clear the TYPE_SPECIFIER_SEQ. */ diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b3576432844..fad9efadcc0 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -110,11 +110,12 @@ static void pop_tinst_level (void); static tree reopen_tinst_level (struct tinst_level *); static tree tsubst_initializer_list (tree, tree); static tree get_class_bindings (tree, tree, tree); -static tree coerce_template_parms (tree, tree, tree, int, bool, bool); +static tree coerce_template_parms (tree, tree, tree, tsubst_flags_t, + bool, bool); static void tsubst_enum (tree, tree, tree); static tree add_to_template_args (tree, tree); static tree add_outermost_template_args (tree, tree); -static bool check_instantiated_args (tree, tree, int); +static bool check_instantiated_args (tree, tree, tsubst_flags_t); static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*, tree); static int type_unification_real (tree, tree, tree, tree, @@ -122,7 +123,8 @@ static int type_unification_real (tree, tree, tree, tree, static void note_template_header (int); static tree convert_nontype_argument_function (tree, tree); static tree convert_nontype_argument (tree, tree); -static tree convert_template_argument (tree, tree, tree, int, int, tree); +static tree convert_template_argument (tree, tree, tree, + tsubst_flags_t, int, tree); static int for_each_template_parm (tree, tree_fn_t, void*, struct pointer_set_t*, bool); static tree expand_template_argument_pack (tree); @@ -131,7 +133,7 @@ static bool inline_needs_template_parms (tree); static void push_inline_template_parms_recursive (tree, int); static tree retrieve_local_specialization (tree); static void register_local_specialization (tree, tree); -static tree reduce_template_parm_level (tree, tree, int, tree, int); +static tree reduce_template_parm_level (tree, tree, int, tree, tsubst_flags_t); static int mark_template_parm (tree, void *); static int template_parm_this_level_p (tree, void *); static tree tsubst_friend_function (tree, tree); @@ -142,35 +144,36 @@ static int template_decl_level (tree); static int check_cv_quals_for_unify (int, tree, tree); static void template_parm_level_and_index (tree, int*, int*); static int unify_pack_expansion (tree, tree, tree, tree, int, bool, bool); -static tree tsubst_template_arg (tree, tree, int, tree); -static tree tsubst_template_args (tree, tree, int, tree); -static tree tsubst_template_parms (tree, tree, int); +static tree tsubst_template_arg (tree, tree, tsubst_flags_t, tree); +static tree tsubst_template_args (tree, tree, tsubst_flags_t, tree); +static tree tsubst_template_parms (tree, tree, tsubst_flags_t); static void regenerate_decl_from_template (tree, tree); static tree most_specialized_class (tree, tree); -static tree tsubst_aggr_type (tree, tree, int, tree, int); -static tree tsubst_arg_types (tree, tree, int, tree); -static tree tsubst_function_type (tree, tree, int, tree); +static tree tsubst_aggr_type (tree, tree, tsubst_flags_t, tree, int); +static tree tsubst_arg_types (tree, tree, tsubst_flags_t, tree); +static tree tsubst_function_type (tree, tree, tsubst_flags_t, tree); static bool check_specialization_scope (void); static tree process_partial_specialization (tree); static void set_current_access_from_decl (tree); static tree get_template_base (tree, tree, tree, tree); static tree try_class_unification (tree, tree, tree, tree); -static int coerce_template_template_parms (tree, tree, int, tree, tree); +static int coerce_template_template_parms (tree, tree, tsubst_flags_t, + tree, tree); static bool template_template_parm_bindings_ok_p (tree, tree); static int template_args_equal (tree, tree); static void tsubst_default_arguments (tree); static tree for_each_template_parm_r (tree *, int *, void *); static tree copy_default_args_to_explicit_spec_1 (tree, tree); static void copy_default_args_to_explicit_spec (tree); -static int invalid_nontype_parm_type_p (tree, int); +static int invalid_nontype_parm_type_p (tree, tsubst_flags_t); static int eq_local_specializations (const void *, const void *); static bool dependent_template_arg_p (tree); static bool any_template_arguments_need_structural_equality_p (tree); static bool dependent_type_p_r (tree); -static tree tsubst (tree, tree, int, tree); -static tree tsubst_expr (tree, tree, int, tree, bool); -static tree tsubst_copy (tree, tree, int, tree); -static tree tsubst_pack_expansion (tree, tree, int, tree); +static tree tsubst (tree, tree, tsubst_flags_t, tree); +static tree tsubst_expr (tree, tree, tsubst_flags_t, tree, bool); +static tree tsubst_copy (tree, tree, tsubst_flags_t, tree); +static tree tsubst_pack_expansion (tree, tree, tsubst_flags_t, tree); /* Make the current scope suitable for access checking when we are processing T. T can be FUNCTION_DECL for instantiated function @@ -2912,7 +2915,7 @@ canonical_type_parameter (tree type) static tree reduce_template_parm_level (tree index, tree type, int levels, tree args, - int complain) + tsubst_flags_t complain) { if (TEMPLATE_PARM_DESCENDANTS (index) == NULL_TREE || (TEMPLATE_PARM_LEVEL (TEMPLATE_PARM_DESCENDANTS (index)) @@ -4655,7 +4658,7 @@ convert_nontype_argument (tree type, tree expr) static int coerce_template_template_parm (tree parm, tree arg, - int complain, + tsubst_flags_t complain, tree in_decl, tree outer_args) { @@ -4733,7 +4736,7 @@ coerce_template_template_parm (tree parm, static int coerce_template_template_parms (tree parm_parms, tree arg_parms, - int complain, + tsubst_flags_t complain, tree in_decl, tree outer_args) { @@ -4912,7 +4915,7 @@ static tree convert_template_argument (tree parm, tree arg, tree args, - int complain, + tsubst_flags_t complain, int i, tree in_decl) { @@ -5122,7 +5125,7 @@ coerce_template_parameter_pack (tree parms, tree new_args, int* lost, tree in_decl, - int complain) + tsubst_flags_t complain) { tree parm = TREE_VEC_ELT (parms, parm_idx); int nargs = inner_args ? NUM_TMPL_ARGS (inner_args) : 0; @@ -5241,7 +5244,7 @@ static tree coerce_template_parms (tree parms, tree args, tree in_decl, - int complain, + tsubst_flags_t complain, bool require_all_args, bool use_default_args) { @@ -5590,7 +5593,7 @@ lookup_template_class (tree d1, tree in_decl, tree context, int entering_scope, - int complain) + tsubst_flags_t complain) { tree templ = NULL_TREE, parmlist; tree t; @@ -6851,7 +6854,7 @@ can_complete_type_without_circularity (tree type) static void apply_late_template_attributes (tree *decl_p, tree attributes, int attr_flags, - tree args, int complain, tree in_decl) + tree args, tsubst_flags_t complain, tree in_decl) { tree last_dep = NULL_TREE; tree t; @@ -7411,7 +7414,7 @@ instantiate_class_template (tree type) } static tree -tsubst_template_arg (tree t, tree args, int complain, tree in_decl) +tsubst_template_arg (tree t, tree args, tsubst_flags_t complain, tree in_decl) { tree r; @@ -7434,7 +7437,8 @@ tsubst_template_arg (tree t, tree args, int complain, tree in_decl) (if only a partial substitution could be performed) or ERROR_MARK_NODE if there was an error. */ tree -tsubst_pack_expansion (tree t, tree args, int complain, tree in_decl) +tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, + tree in_decl) { tree pattern; tree pack, packs = NULL_TREE, unsubstituted_packs = NULL_TREE; @@ -7641,7 +7645,7 @@ tsubst_pack_expansion (tree t, tree args, int complain, tree in_decl) /* Substitute ARGS into the vector or list of template arguments T. */ static tree -tsubst_template_args (tree t, tree args, int complain, tree in_decl) +tsubst_template_args (tree t, tree args, tsubst_flags_t complain, tree in_decl) { tree orig_t = t; int len = TREE_VEC_LENGTH (t); @@ -7738,7 +7742,7 @@ tsubst_template_args (tree t, tree args, int complain, tree in_decl) result will be `template <int*, double, class V>'. */ static tree -tsubst_template_parms (tree parms, tree args, int complain) +tsubst_template_parms (tree parms, tree args, tsubst_flags_t complain) { tree r = NULL_TREE; tree* new_parms; @@ -7806,7 +7810,7 @@ tsubst_template_parms (tree parms, tree args, int complain) static tree tsubst_aggr_type (tree t, tree args, - int complain, + tsubst_flags_t complain, tree in_decl, int entering_scope) { @@ -7967,7 +7971,7 @@ tsubst_default_arguments (tree fn) control of COMPLAIN. */ static tree -tsubst_decl (tree t, tree args, int complain) +tsubst_decl (tree t, tree args, tsubst_flags_t complain) { location_t saved_loc; tree r = NULL_TREE; @@ -8712,7 +8716,7 @@ tsubst_decl (tree t, tree args, int complain) static tree tsubst_arg_types (tree arg_types, tree args, - int complain, + tsubst_flags_t complain, tree in_decl) { tree remaining_arg_types; @@ -8818,7 +8822,7 @@ tsubst_arg_types (tree arg_types, static tree tsubst_function_type (tree t, tree args, - int complain, + tsubst_flags_t complain, tree in_decl) { tree return_type; @@ -8892,7 +8896,7 @@ tsubst_function_type (tree t, static tree tsubst_exception_specification (tree fntype, tree args, - int complain, + tsubst_flags_t complain, tree in_decl) { tree specs; @@ -8972,7 +8976,7 @@ tsubst_exception_specification (tree fntype, for expressions, use tsubst_expr or tsubst_copy. */ static tree -tsubst (tree t, tree args, int complain, tree in_decl) +tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) { tree type, r; @@ -9695,7 +9699,7 @@ tsubst (tree t, tree args, int complain, tree in_decl) static tree tsubst_baselink (tree baselink, tree object_type, - tree args, int complain, tree in_decl) + tree args, tsubst_flags_t complain, tree in_decl) { tree name; tree qualifying_scope; @@ -9761,7 +9765,7 @@ tsubst_baselink (tree baselink, tree object_type, static tree tsubst_qualified_id (tree qualified_id, tree args, - int complain, tree in_decl, + tsubst_flags_t complain, tree in_decl, bool done, bool address_p) { tree expr; @@ -9876,7 +9880,7 @@ tsubst_qualified_id (tree qualified_id, tree args, tsubst_expr. */ static tree -tsubst_copy (tree t, tree args, int complain, tree in_decl) +tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) { enum tree_code code; tree r; @@ -10311,7 +10315,8 @@ tsubst_copy (tree t, tree args, int complain, tree in_decl) /* Like tsubst_copy, but specifically for OpenMP clauses. */ static tree -tsubst_omp_clauses (tree clauses, tree args, int complain, tree in_decl) +tsubst_omp_clauses (tree clauses, tree args, tsubst_flags_t complain, + tree in_decl) { tree new_clauses = NULL, nc, oc; @@ -10363,7 +10368,8 @@ tsubst_omp_clauses (tree clauses, tree args, int complain, tree in_decl) /* Like tsubst_copy_and_build, but unshare TREE_LIST nodes. */ static tree -tsubst_copy_asm_operands (tree t, tree args, int complain, tree in_decl) +tsubst_copy_asm_operands (tree t, tree args, tsubst_flags_t complain, + tree in_decl) { #define RECUR(t) tsubst_copy_asm_operands (t, args, complain, in_decl) @@ -10398,7 +10404,7 @@ tsubst_copy_asm_operands (tree t, tree args, int complain, tree in_decl) static void tsubst_omp_for_iterator (tree t, int i, tree declv, tree initv, tree condv, tree incrv, tree *clauses, - tree args, int complain, tree in_decl, + tree args, tsubst_flags_t complain, tree in_decl, bool integral_constant_expression_p) { #define RECUR(NODE) \ @@ -10538,7 +10544,7 @@ tsubst_omp_for_iterator (tree t, int i, tree declv, tree initv, processing. */ static tree -tsubst_expr (tree t, tree args, int complain, tree in_decl, +tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl, bool integral_constant_expression_p) { #define RECUR(NODE) \ @@ -10988,7 +10994,7 @@ tsubst_expr (tree t, tree args, int complain, tree in_decl, static tree tsubst_non_call_postfix_expression (tree t, tree args, - int complain, + tsubst_flags_t complain, tree in_decl) { if (TREE_CODE (t) == SCOPE_REF) @@ -11008,7 +11014,7 @@ tsubst_non_call_postfix_expression (tree t, tree args, tree tsubst_copy_and_build (tree t, tree args, - int complain, + tsubst_flags_t complain, tree in_decl, bool function_p, bool integral_constant_expression_p) @@ -11788,7 +11794,7 @@ tsubst_copy_and_build (tree t, Emit an error under control of COMPLAIN, and return TRUE on error. */ static bool -check_instantiated_arg (tree tmpl, tree t, int complain) +check_instantiated_arg (tree tmpl, tree t, tsubst_flags_t complain) { if (ARGUMENT_PACK_P (t)) { @@ -11848,7 +11854,7 @@ check_instantiated_arg (tree tmpl, tree t, int complain) } static bool -check_instantiated_args (tree tmpl, tree args, int complain) +check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain) { int ix, len = DECL_NTPARMS (tmpl); bool result = false; @@ -11867,7 +11873,7 @@ check_instantiated_args (tree tmpl, tree args, int complain) the template arguments in TARG_PTR. */ tree -instantiate_template (tree tmpl, tree targ_ptr, int complain) +instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain) { tree fndecl; tree gen_tmpl; @@ -14826,7 +14832,7 @@ instantiate_class_member (tree decl, int extern_p) since the standard is unclear (as detailed below). */ void -do_type_instantiation (tree t, tree storage, int complain) +do_type_instantiation (tree t, tree storage, tsubst_flags_t complain) { int extern_p = 0; int nomem_p = 0; @@ -15893,7 +15899,7 @@ current_instantiation (void) warning messages under control of COMPLAIN. */ static int -invalid_nontype_parm_type_p (tree type, int complain) +invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain) { if (INTEGRAL_TYPE_P (type)) return 0; diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 76c68bfe34f..1d5da671437 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -104,7 +104,7 @@ static GTY (()) VEC(tinfo_s,gc) *tinfo_descs; static tree ifnonnull (tree, tree); static tree tinfo_name (tree); -static tree build_dynamic_cast_1 (tree, tree, int); +static tree build_dynamic_cast_1 (tree, tree, tsubst_flags_t); static tree throw_bad_cast (void); static tree throw_bad_typeid (void); static tree get_tinfo_decl_dynamic (tree); @@ -488,7 +488,7 @@ ifnonnull (tree test, tree result) paper. */ static tree -build_dynamic_cast_1 (tree type, tree expr, int complain) +build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain) { enum tree_code tc = TREE_CODE (type); tree exprtype = TREE_TYPE (expr); @@ -743,7 +743,7 @@ build_dynamic_cast_1 (tree type, tree expr, int complain) } tree -build_dynamic_cast (tree type, tree expr, int complain) +build_dynamic_cast (tree type, tree expr, tsubst_flags_t complain) { if (type == error_mark_node || expr == error_mark_node) return error_mark_node; diff --git a/gcc/cp/search.c b/gcc/cp/search.c index cb54c9d8c30..4f36e643268 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -189,7 +189,7 @@ accessible_base_p (tree t, tree base, bool consider_local_p) NULL_TREE is returned. */ tree -lookup_base (tree t, tree base, int access, base_kind *kind_ptr) +lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr) { tree binfo; tree t_binfo; diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index c4e11c437a2..ec2e1ecae77 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1849,7 +1849,7 @@ perform_koenig_lookup (tree fn, tree args) tree finish_call_expr (tree fn, tree args, bool disallow_virtual, int koenig_p, - int complain) + tsubst_flags_t complain) { tree result; tree orig_fn; diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 5792eb2468d..456abfc9443 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -44,7 +44,7 @@ static tree build_cplus_array_type_1 (tree, tree); static int list_hash_eq (const void *, const void *); static hashval_t list_hash_pieces (tree, tree, tree); static hashval_t list_hash (const void *); -static int lvalue_p_1 (tree, int); +static cp_lvalue_kind lvalue_p_1 (tree, int); static tree build_target_expr (tree, tree); static tree count_trees_r (tree *, int *, void *); static tree verify_stmt_tree_r (tree *, int *, void *); @@ -58,12 +58,12 @@ static tree handle_init_priority_attribute (tree *, tree, tree, int, bool *); Otherwise, returns clk_none. If TREAT_CLASS_RVALUES_AS_LVALUES is nonzero, rvalues of class type are considered lvalues. */ -static int +static cp_lvalue_kind lvalue_p_1 (tree ref, int treat_class_rvalues_as_lvalues) { - int op1_lvalue_kind = clk_none; - int op2_lvalue_kind = clk_none; + cp_lvalue_kind op1_lvalue_kind = clk_none; + cp_lvalue_kind op2_lvalue_kind = clk_none; /* Expressions of reference type are sometimes wrapped in INDIRECT_REFs. INDIRECT_REFs are just internal compiler @@ -241,7 +241,7 @@ lvalue_p_1 (tree ref, [basic.lval]. This function should really be named lvalue_p; it computes the C++ definition of lvalue. */ -int +cp_lvalue_kind real_lvalue_p (tree ref) { return lvalue_p_1 (ref, @@ -748,7 +748,7 @@ c_build_qualified_type (tree type, int type_quals) tree cp_build_qualified_type_real (tree type, int type_quals, - int complain) + tsubst_flags_t complain) { tree result; int bad_quals = TYPE_UNQUALIFIED; diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 3b5a0a97bf1..91fb48592ec 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see static tree pfn_from_ptrmemfunc (tree); static tree delta_from_ptrmemfunc (tree); static tree convert_for_assignment (tree, tree, const char *, tree, int, - int); + tsubst_flags_t); static tree cp_pointer_int_sum (enum tree_code, tree, tree); static tree rationalize_conditional_expr (enum tree_code, tree, tsubst_flags_t); @@ -61,7 +61,8 @@ static void casts_away_constness_r (tree *, tree *); static bool casts_away_constness (tree, tree); static void maybe_warn_about_returning_address_of_local (tree); static tree lookup_destructor (tree, tree, tree); -static int convert_arguments (int, tree *, tree, tree, tree, int, int); +static int convert_arguments (int, tree *, tree, tree, tree, int, + tsubst_flags_t); /* Do `exp = require_complete_type (exp);' to make sure exp does not have an incomplete type. (That includes void types.) @@ -416,7 +417,7 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2) static tree composite_pointer_type_r (tree t1, tree t2, const char* location, - int complain) + tsubst_flags_t complain) { tree pointee1; tree pointee2; @@ -491,7 +492,7 @@ composite_pointer_type_r (tree t1, tree t2, const char* location, tree composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2, - const char* location, int complain) + const char* location, tsubst_flags_t complain) { tree class1; tree class2; @@ -1505,7 +1506,7 @@ cxx_sizeof_or_alignof_expr (tree e, enum tree_code op, bool complain) violates these rules. */ bool -invalid_nonstatic_memfn_p (const_tree expr, int complain) +invalid_nonstatic_memfn_p (const_tree expr, tsubst_flags_t complain) { if (DECL_NONSTATIC_MEMBER_FUNCTION_P (expr)) { @@ -1873,7 +1874,7 @@ lookup_anon_field (tree t, tree type) tree build_class_member_access_expr (tree object, tree member, tree access_path, bool preserve_reference, - int complain) + tsubst_flags_t complain) { tree object_type; tree member_scope; @@ -2221,7 +2222,7 @@ check_template_keyword (tree decl) tree finish_class_member_access_expr (tree object, tree name, bool template_p, - int complain) + tsubst_flags_t complain) { tree expr; tree object_type; @@ -2429,7 +2430,7 @@ build_ptrmemfunc_access_expr (tree ptrmem, tree member_name) tree build_x_indirect_ref (tree expr, const char *errorstring, - int complain) + tsubst_flags_t complain) { tree orig_expr = expr; tree rval; @@ -2461,7 +2462,8 @@ build_indirect_ref (location_t loc __attribute__ ((__unused__)), } tree -cp_build_indirect_ref (tree ptr, const char *errorstring, int complain) +cp_build_indirect_ref (tree ptr, const char *errorstring, + tsubst_flags_t complain) { tree pointer, type; @@ -2856,7 +2858,7 @@ build_function_call (tree function, tree params) } tree -cp_build_function_call (tree function, tree params, int complain) +cp_build_function_call (tree function, tree params, tsubst_flags_t complain) { tree fntype, fndecl; tree name = NULL_TREE; @@ -2974,7 +2976,7 @@ cp_build_function_call (tree function, tree params, int complain) static int convert_arguments (int nargs, tree *argarray, tree typelist, tree values, tree fndecl, int flags, - int complain) + tsubst_flags_t complain) { tree typetail, valtail; const char *called_thing = 0; @@ -3155,7 +3157,7 @@ convert_arguments (int nargs, tree *argarray, tree build_x_binary_op (enum tree_code code, tree arg1, enum tree_code arg1_code, tree arg2, enum tree_code arg2_code, bool *overloaded_p, - int complain) + tsubst_flags_t complain) { tree orig_arg1; tree orig_arg2; @@ -3199,7 +3201,7 @@ build_x_binary_op (enum tree_code code, tree arg1, enum tree_code arg1_code, /* Build and return an ARRAY_REF expression. */ tree -build_x_array_ref (tree arg1, tree arg2, int complain) +build_x_array_ref (tree arg1, tree arg2, tsubst_flags_t complain) { tree orig_arg1 = arg1; tree orig_arg2 = arg2; @@ -3255,7 +3257,7 @@ build_binary_op (location_t location, enum tree_code code, tree op0, tree op1, tree cp_build_binary_op (location_t location, enum tree_code code, tree orig_op0, tree orig_op1, - int complain) + tsubst_flags_t complain) { tree op0, op1; enum tree_code code0, code1; @@ -4082,7 +4084,7 @@ pointer_diff (tree op0, tree op1, tree ptrtype) and XARG is the operand. */ tree -build_x_unary_op (enum tree_code code, tree xarg, int complain) +build_x_unary_op (enum tree_code code, tree xarg, tsubst_flags_t complain) { tree orig_expr = xarg; tree exp; @@ -4235,7 +4237,7 @@ build_nop (tree type, tree expr) tree cp_build_unary_op (enum tree_code code, tree xarg, int noconvert, - int complain) + tsubst_flags_t complain) { /* No default_conversion here. It causes trouble for ADDR_EXPR. */ tree arg = xarg; @@ -4899,7 +4901,8 @@ cxx_mark_addressable (tree exp) /* Build and return a conditional expression IFEXP ? OP1 : OP2. */ tree -build_x_conditional_expr (tree ifexp, tree op1, tree op2, int complain) +build_x_conditional_expr (tree ifexp, tree op1, tree op2, + tsubst_flags_t complain) { tree orig_ifexp = ifexp; tree orig_op1 = op1; @@ -4952,7 +4955,7 @@ tree build_x_compound_expr_from_list (tree list, const char *msg) /* Handle overloading of the ',' operator when needed. */ tree -build_x_compound_expr (tree op1, tree op2, int complain) +build_x_compound_expr (tree op1, tree op2, tsubst_flags_t complain) { tree result; tree orig_op1 = op1; @@ -4989,7 +4992,7 @@ build_compound_expr (tree lhs, tree rhs) /* Build a compound expression. */ tree -cp_build_compound_expr (tree lhs, tree rhs, int complain) +cp_build_compound_expr (tree lhs, tree rhs, tsubst_flags_t complain) { lhs = convert_to_void (lhs, "left-hand operand of comma", complain); @@ -5129,7 +5132,7 @@ ignore_overflows (tree expr, tree orig) static tree build_static_cast_1 (tree type, tree expr, bool c_cast_p, - bool *valid_p, int complain) + bool *valid_p, tsubst_flags_t complain) { tree intype; tree result; @@ -5330,7 +5333,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p, /* Return an expression representing static_cast<TYPE>(EXPR). */ tree -build_static_cast (tree type, tree expr, int complain) +build_static_cast (tree type, tree expr, tsubst_flags_t complain) { tree result; bool valid_p; @@ -5405,7 +5408,7 @@ convert_member_func_to_ptr (tree type, tree expr) static tree build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, - bool *valid_p, int complain) + bool *valid_p, tsubst_flags_t complain) { tree intype; @@ -5562,7 +5565,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, } tree -build_reinterpret_cast (tree type, tree expr, int complain) +build_reinterpret_cast (tree type, tree expr, tsubst_flags_t complain) { if (type == error_mark_node || expr == error_mark_node) return error_mark_node; @@ -5699,7 +5702,7 @@ build_const_cast_1 (tree dst_type, tree expr, bool complain, } tree -build_const_cast (tree type, tree expr, int complain) +build_const_cast (tree type, tree expr, tsubst_flags_t complain) { if (type == error_mark_node || error_operand_p (expr)) return error_mark_node; @@ -5731,7 +5734,7 @@ build_c_cast (tree type, tree expr) TYPE of expression EXPR. */ tree -cp_build_c_cast (tree type, tree expr, int complain) +cp_build_c_cast (tree type, tree expr, tsubst_flags_t complain) { tree value = expr; tree result; @@ -5852,7 +5855,7 @@ build_modify_expr (location_t location ATTRIBUTE_UNUSED, tree cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, - int complain) + tsubst_flags_t complain) { tree result; tree newrhs = rhs; @@ -6153,7 +6156,7 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, tree build_x_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, - int complain) + tsubst_flags_t complain) { if (processing_template_decl) return build_min_nt (MODOP_EXPR, lhs, @@ -6516,7 +6519,7 @@ delta_from_ptrmemfunc (tree t) static tree convert_for_assignment (tree type, tree rhs, const char *errtype, tree fndecl, int parmnum, - int complain) + tsubst_flags_t complain) { tree rhstype; enum tree_code coder; @@ -6659,7 +6662,7 @@ convert_for_assignment (tree type, tree rhs, tree convert_for_initialization (tree exp, tree type, tree rhs, int flags, const char *errtype, tree fndecl, int parmnum, - int complain) + tsubst_flags_t complain) { enum tree_code codel = TREE_CODE (type); tree rhstype; @@ -7396,7 +7399,7 @@ non_reference (tree t) how the lvalue is being used and so selects the error message. */ int -lvalue_or_else (tree ref, enum lvalue_use use, int complain) +lvalue_or_else (tree ref, enum lvalue_use use, tsubst_flags_t complain) { int win = lvalue_p (ref); diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 29c2e9ad019..637076554fb 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1430,7 +1430,7 @@ build_m_component_ref (tree datum, tree component) /* Return a tree node for the expression TYPENAME '(' PARMS ')'. */ tree -build_functional_cast (tree exp, tree parms, int complain) +build_functional_cast (tree exp, tree parms, tsubst_flags_t complain) { /* This is either a call to a constructor, or a C cast in C++'s `functional' notation. */ |