diff options
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r-- | gcc/cp/class.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 154c3b3..69acf11 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -284,7 +284,7 @@ build_base_path (enum tree_code code, if (!want_pointer) /* This must happen before the call to save_expr. */ - expr = build_unary_op (ADDR_EXPR, expr, 0); + expr = cp_build_unary_op (ADDR_EXPR, expr, 0, tf_warning_or_error); offset = BINFO_OFFSET (binfo); fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull); @@ -345,7 +345,7 @@ build_base_path (enum tree_code code, interesting to the optimizers anyway. */ && !has_empty) { - expr = build_indirect_ref (expr, NULL); + expr = cp_build_indirect_ref (expr, NULL, tf_warning_or_error); expr = build_simple_base_path (expr, binfo); if (want_pointer) expr = build_address (expr); @@ -370,10 +370,12 @@ build_base_path (enum tree_code code, t = TREE_TYPE (TYPE_VFIELD (current_class_type)); t = build_pointer_type (t); v_offset = convert (t, current_vtt_parm); - v_offset = build_indirect_ref (v_offset, NULL); + v_offset = cp_build_indirect_ref (v_offset, NULL, + tf_warning_or_error); } else - v_offset = build_vfield_ref (build_indirect_ref (expr, NULL), + v_offset = build_vfield_ref (cp_build_indirect_ref (expr, NULL, + tf_warning_or_error), TREE_TYPE (TREE_TYPE (expr))); v_offset = build2 (POINTER_PLUS_EXPR, TREE_TYPE (v_offset), @@ -381,7 +383,7 @@ build_base_path (enum tree_code code, v_offset = build1 (NOP_EXPR, build_pointer_type (ptrdiff_type_node), v_offset); - v_offset = build_indirect_ref (v_offset, NULL); + v_offset = cp_build_indirect_ref (v_offset, NULL, tf_warning_or_error); TREE_CONSTANT (v_offset) = 1; TREE_INVARIANT (v_offset) = 1; @@ -425,7 +427,7 @@ build_base_path (enum tree_code code, null_test = NULL; if (!want_pointer) - expr = build_indirect_ref (expr, NULL); + expr = cp_build_indirect_ref (expr, NULL, tf_warning_or_error); out: if (null_test) @@ -459,7 +461,7 @@ build_simple_base_path (tree expr, tree binfo) in the back end. */ temp = unary_complex_lvalue (ADDR_EXPR, expr); if (temp) - expr = build_indirect_ref (temp, NULL); + expr = cp_build_indirect_ref (temp, NULL, tf_warning_or_error); return expr; } @@ -551,7 +553,8 @@ convert_to_base_statically (tree expr, tree base) when processing a template because they do not handle C++-specific trees. */ gcc_assert (!processing_template_decl); - expr = build_unary_op (ADDR_EXPR, expr, /*noconvert=*/1); + expr = cp_build_unary_op (ADDR_EXPR, expr, /*noconvert=*/1, + tf_warning_or_error); if (!integer_zerop (BINFO_OFFSET (base))) expr = fold_build2 (POINTER_PLUS_EXPR, pointer_type, expr, fold_convert (sizetype, BINFO_OFFSET (base))); @@ -648,13 +651,16 @@ build_vfn_ref (tree instance_ptr, tree idx) { tree aref; - aref = build_vtbl_ref_1 (build_indirect_ref (instance_ptr, 0), idx); + aref = build_vtbl_ref_1 (cp_build_indirect_ref (instance_ptr, 0, + tf_warning_or_error), + idx); /* When using function descriptors, the address of the vtable entry is treated as a function pointer. */ if (TARGET_VTABLE_USES_DESCRIPTORS) aref = build1 (NOP_EXPR, TREE_TYPE (aref), - build_unary_op (ADDR_EXPR, aref, /*noconvert=*/1)); + cp_build_unary_op (ADDR_EXPR, aref, /*noconvert=*/1, + tf_warning_or_error)); /* Remember this as a method reference, for later devirtualization. */ aref = build3 (OBJ_TYPE_REF, TREE_TYPE (aref), aref, instance_ptr, idx); @@ -6098,10 +6104,10 @@ resolve_address_of_overloaded_function (tree target_type, } if (TYPE_PTRFN_P (target_type) || TYPE_PTRMEMFUNC_P (target_type)) - return build_unary_op (ADDR_EXPR, fn, 0); + return cp_build_unary_op (ADDR_EXPR, fn, 0, flags); else { - /* The target must be a REFERENCE_TYPE. Above, build_unary_op + /* The target must be a REFERENCE_TYPE. Above, cp_build_unary_op will mark the function as addressed, but here we must do it explicitly. */ cxx_mark_addressable (fn); |