Commit 525521b6 by Douglas Gregor Committed by Doug Gregor

re PR bootstrap/35704 (Bootstrap failure on i686-apple-darwin9 at revision 133519 (take 2).)

2008-03-27  Douglas Gregor  <doug.gregor@gmail.com>

	PR obj-c++/35704
	* typeck.c (build_x_compound_expr): Use cp_build_compound_expr.
	(build_compound_expr): New, for compatibility with C
	build_compound_expr.
	(cp_build_compound_expr): Renamed from build_compound_expr.
	(build_c_cast): New, for compatibility with C build_c_cast.
	(cp_build_c_cast): Renamed from build_c_cast.
	* init.c (build_vec_delete_1): Fix calls to build_compound_expr.
	* decl.c (cxx_maybe_build_cleanup): Ditto.
	* cp-tree.h (build_compound_expr): Add C-compatibile prototype.
	(cp_build_compound_expr): Renamed from build_compound_expr.
	(build_c_cast): Add C-compatible prototype.
	(cp_build_c_cast): Renamed from build_c_cast.
	* typeck2.c (build_functional_cast): Use cp_build_c_cast.
	* parser.c (cp_parser_cast_expression): Fix call to build_c_cast.

2008-03-27  Douglas Gregor  <doug.gregor@gmail.com>

	PR obj-c++/35704	
	* objc-act.c (objc_build_component_ref): Fix call to
	finish_class_member_access_expr.
	(objc_generate_cxx_ctor_or_dtor): Fix call to
	build_special_member_call.

From-SVN: r133643
parent 063cc99c
2008-03-27 Douglas Gregor <doug.gregor@gmail.com> 2008-03-27 Douglas Gregor <doug.gregor@gmail.com>
PR obj-c++/35704
* typeck.c (build_x_compound_expr): Use cp_build_compound_expr.
(build_compound_expr): New, for compatibility with C
build_compound_expr.
(cp_build_compound_expr): Renamed from build_compound_expr.
(build_c_cast): New, for compatibility with C build_c_cast.
(cp_build_c_cast): Renamed from build_c_cast.
* init.c (build_vec_delete_1): Fix calls to build_compound_expr.
* decl.c (cxx_maybe_build_cleanup): Ditto.
* cp-tree.h (build_compound_expr): Add C-compatibile prototype.
(cp_build_compound_expr): Renamed from build_compound_expr.
(build_c_cast): Add C-compatible prototype.
(cp_build_c_cast): Renamed from build_c_cast.
* typeck2.c (build_functional_cast): Use cp_build_c_cast.
* parser.c (cp_parser_cast_expression): Fix call to build_c_cast.
2008-03-27 Douglas Gregor <doug.gregor@gmail.com>
* pt.c (tsubst_copy) <case SIZEOF_EXPR>: Cope with * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Cope with
tsubst_pack_expansion returning a pack expansion, or a TREE_VEC tsubst_pack_expansion returning a pack expansion, or a TREE_VEC
ending in a pack expansion, both of which can occur when ending in a pack expansion, both of which can occur when
......
...@@ -4804,11 +4804,13 @@ extern tree build_x_conditional_expr (tree, tree, tree, ...@@ -4804,11 +4804,13 @@ extern tree build_x_conditional_expr (tree, tree, tree,
tsubst_flags_t); tsubst_flags_t);
extern tree build_x_compound_expr_from_list (tree, const char *); extern tree build_x_compound_expr_from_list (tree, const char *);
extern tree build_x_compound_expr (tree, tree, tsubst_flags_t); extern tree build_x_compound_expr (tree, tree, tsubst_flags_t);
extern tree build_compound_expr (tree, tree, tsubst_flags_t); extern tree build_compound_expr (tree, tree);
extern tree cp_build_compound_expr (tree, tree, tsubst_flags_t);
extern tree build_static_cast (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_reinterpret_cast (tree, tree, tsubst_flags_t);
extern tree build_const_cast (tree, tree, tsubst_flags_t); extern tree build_const_cast (tree, tree, tsubst_flags_t);
extern tree build_c_cast (tree, tree, tsubst_flags_t); extern tree build_c_cast (tree, tree);
extern tree cp_build_c_cast (tree, tree, tsubst_flags_t);
extern tree build_x_modify_expr (tree, enum tree_code, tree, extern tree build_x_modify_expr (tree, enum tree_code, tree,
tsubst_flags_t); tsubst_flags_t);
extern tree cp_build_modify_expr (tree, enum tree_code, tree, extern tree cp_build_modify_expr (tree, enum tree_code, tree,
......
...@@ -12229,7 +12229,7 @@ cxx_maybe_build_cleanup (tree decl) ...@@ -12229,7 +12229,7 @@ cxx_maybe_build_cleanup (tree decl)
call = build_delete (TREE_TYPE (addr), addr, call = build_delete (TREE_TYPE (addr), addr,
sfk_complete_destructor, flags, 0); sfk_complete_destructor, flags, 0);
if (cleanup) if (cleanup)
cleanup = build_compound_expr (cleanup, call, tf_warning_or_error); cleanup = build_compound_expr (cleanup, call);
else else
cleanup = call; cleanup = call;
} }
......
...@@ -2528,15 +2528,13 @@ build_vec_delete_1 (tree base, tree maxindex, tree type, ...@@ -2528,15 +2528,13 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
body = build_compound_expr body = build_compound_expr
(body, cp_build_modify_expr (tbase, NOP_EXPR, (body, cp_build_modify_expr (tbase, NOP_EXPR,
build2 (POINTER_PLUS_EXPR, ptype, tbase, tmp), build2 (POINTER_PLUS_EXPR, ptype, tbase, tmp),
tf_warning_or_error), tf_warning_or_error));
tf_warning_or_error);
body = build_compound_expr body = build_compound_expr
(body, build_delete (ptype, tbase, sfk_complete_destructor, (body, build_delete (ptype, tbase, sfk_complete_destructor,
LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 1), LOOKUP_NORMAL|LOOKUP_DESTRUCTOR, 1));
tf_warning_or_error);
loop = build1 (LOOP_EXPR, void_type_node, body); loop = build1 (LOOP_EXPR, void_type_node, body);
loop = build_compound_expr (tbase_init, loop, tf_warning_or_error); loop = build_compound_expr (tbase_init, loop);
no_destructor: no_destructor:
/* If the delete flag is one, or anything else with the low bit set, /* If the delete flag is one, or anything else with the low bit set,
...@@ -2582,7 +2580,7 @@ build_vec_delete_1 (tree base, tree maxindex, tree type, ...@@ -2582,7 +2580,7 @@ build_vec_delete_1 (tree base, tree maxindex, tree type,
else if (!body) else if (!body)
body = deallocate_expr; body = deallocate_expr;
else else
body = build_compound_expr (body, deallocate_expr, tf_warning_or_error); body = build_compound_expr (body, deallocate_expr);
if (!body) if (!body)
body = integer_zero_node; body = integer_zero_node;
......
...@@ -5880,7 +5880,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p) ...@@ -5880,7 +5880,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p)
return error_mark_node; return error_mark_node;
/* Perform the cast. */ /* Perform the cast. */
expr = build_c_cast (type, expr, tf_warning_or_error); expr = build_c_cast (type, expr);
return expr; return expr;
} }
} }
......
...@@ -5037,7 +5037,7 @@ build_x_compound_expr (tree op1, tree op2, tsubst_flags_t complain) ...@@ -5037,7 +5037,7 @@ build_x_compound_expr (tree op1, tree op2, tsubst_flags_t complain)
result = build_new_op (COMPOUND_EXPR, LOOKUP_NORMAL, op1, op2, NULL_TREE, result = build_new_op (COMPOUND_EXPR, LOOKUP_NORMAL, op1, op2, NULL_TREE,
/*overloaded_p=*/NULL, complain); /*overloaded_p=*/NULL, complain);
if (!result) if (!result)
result = build_compound_expr (op1, op2, complain); result = cp_build_compound_expr (op1, op2, complain);
if (processing_template_decl && result != error_mark_node) if (processing_template_decl && result != error_mark_node)
return build_min_non_dep (COMPOUND_EXPR, result, orig_op1, orig_op2); return build_min_non_dep (COMPOUND_EXPR, result, orig_op1, orig_op2);
...@@ -5045,10 +5045,18 @@ build_x_compound_expr (tree op1, tree op2, tsubst_flags_t complain) ...@@ -5045,10 +5045,18 @@ build_x_compound_expr (tree op1, tree op2, tsubst_flags_t complain)
return result; return result;
} }
/* Like cp_build_compound_expr, but for the c-common bits. */
tree
build_compound_expr (tree lhs, tree rhs)
{
return cp_build_compound_expr (lhs, rhs, tf_warning_or_error);
}
/* Build a compound expression. */ /* Build a compound expression. */
tree tree
build_compound_expr (tree lhs, tree rhs, tsubst_flags_t complain) cp_build_compound_expr (tree lhs, tree rhs, tsubst_flags_t complain)
{ {
lhs = convert_to_void (lhs, "left-hand operand of comma", complain); lhs = convert_to_void (lhs, "left-hand operand of comma", complain);
...@@ -5775,11 +5783,19 @@ build_const_cast (tree type, tree expr, tsubst_flags_t complain) ...@@ -5775,11 +5783,19 @@ build_const_cast (tree type, tree expr, tsubst_flags_t complain)
/*valid_p=*/NULL); /*valid_p=*/NULL);
} }
/* Like cp_build_c_cast, but for the c-common bits. */
tree
build_c_cast (tree type, tree expr)
{
return cp_build_c_cast (type, expr, tf_warning_or_error);
}
/* Build an expression representing an explicit C-style cast to type /* Build an expression representing an explicit C-style cast to type
TYPE of expression EXPR. */ TYPE of expression EXPR. */
tree tree
build_c_cast (tree type, tree expr, tsubst_flags_t complain) cp_build_c_cast (tree type, tree expr, tsubst_flags_t complain)
{ {
tree value = expr; tree value = expr;
tree result; tree result;
...@@ -6466,7 +6482,7 @@ build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p) ...@@ -6466,7 +6482,7 @@ build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p)
/* Handle null pointer to member function conversions. */ /* Handle null pointer to member function conversions. */
if (integer_zerop (pfn)) if (integer_zerop (pfn))
{ {
pfn = build_c_cast (type, integer_zero_node, tf_warning_or_error); pfn = build_c_cast (type, integer_zero_node);
return build_ptrmemfunc1 (to_type, return build_ptrmemfunc1 (to_type,
integer_zero_node, integer_zero_node,
pfn); pfn);
......
...@@ -1342,7 +1342,7 @@ build_functional_cast (tree exp, tree parms, tsubst_flags_t complain) ...@@ -1342,7 +1342,7 @@ build_functional_cast (tree exp, tree parms, tsubst_flags_t complain)
/* This must build a C cast. */ /* This must build a C cast. */
parms = build_x_compound_expr_from_list (parms, "functional cast"); parms = build_x_compound_expr_from_list (parms, "functional cast");
return build_c_cast (type, parms, complain); return cp_build_c_cast (type, parms, complain);
} }
/* Prepare to evaluate as a call to a constructor. If this expression /* Prepare to evaluate as a call to a constructor. If this expression
...@@ -1363,7 +1363,7 @@ build_functional_cast (tree exp, tree parms, tsubst_flags_t complain) ...@@ -1363,7 +1363,7 @@ build_functional_cast (tree exp, tree parms, tsubst_flags_t complain)
conversion is equivalent (in definedness, and if defined in conversion is equivalent (in definedness, and if defined in
meaning) to the corresponding cast expression. */ meaning) to the corresponding cast expression. */
if (parms && TREE_CHAIN (parms) == NULL_TREE) if (parms && TREE_CHAIN (parms) == NULL_TREE)
return build_c_cast (type, TREE_VALUE (parms), complain); return cp_build_c_cast (type, TREE_VALUE (parms), complain);
/* [expr.type.conv] /* [expr.type.conv]
......
2008-03-27 Douglas Gregor <doug.gregor@gmail.com>
PR obj-c++/35704
* objc-act.c (objc_build_component_ref): Fix call to
finish_class_member_access_expr.
(objc_generate_cxx_ctor_or_dtor): Fix call to
build_special_member_call.
2008-03-25 Andrew Pinski <pinskia@gmail.com> 2008-03-25 Andrew Pinski <pinskia@gmail.com>
PR objc/29197 PR objc/29197
......
...@@ -1255,7 +1255,8 @@ objc_build_component_ref (tree datum, tree component) ...@@ -1255,7 +1255,8 @@ objc_build_component_ref (tree datum, tree component)
front-end, but 'finish_class_member_access_expr' seems to be front-end, but 'finish_class_member_access_expr' seems to be
a worthy substitute. */ a worthy substitute. */
#ifdef OBJCPLUS #ifdef OBJCPLUS
return finish_class_member_access_expr (datum, component, false); return finish_class_member_access_expr (datum, component, false,
tf_warning_or_error);
#else #else
return build_component_ref (datum, component); return build_component_ref (datum, component);
#endif #endif
...@@ -4493,7 +4494,7 @@ objc_generate_cxx_ctor_or_dtor (bool dtor) ...@@ -4493,7 +4494,7 @@ objc_generate_cxx_ctor_or_dtor (bool dtor)
(build_special_member_call (build_special_member_call
(build_ivar_reference (DECL_NAME (ivar)), (build_ivar_reference (DECL_NAME (ivar)),
dtor ? complete_dtor_identifier : complete_ctor_identifier, dtor ? complete_dtor_identifier : complete_ctor_identifier,
NULL_TREE, type, LOOKUP_NORMAL)); NULL_TREE, type, LOOKUP_NORMAL, tf_warning_or_error));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment