Commit bfba94bd by Michael Matz Committed by Michael Matz

typeck.c (cp_pointer_int_sum): Complete inner type which is used later by size_in_bytes().

2002-03-01  Michael Matz  <matz@suse.de>

        * typeck.c (cp_pointer_int_sum): Complete inner type which is
        used later by size_in_bytes().

From-SVN: r50197
parent b41a6f95
2002-03-01 Michael Matz <matz@suse.de>
* typeck.c (cp_pointer_int_sum): Complete inner type which is
used later by size_in_bytes().
2002-03-01 Phil Edwards <pme@gcc.gnu.org> 2002-03-01 Phil Edwards <pme@gcc.gnu.org>
* cp-tree.h: Require __GNUC__ to be #defined. * cp-tree.h: Require __GNUC__ to be #defined.
......
...@@ -4076,8 +4076,14 @@ cp_pointer_int_sum (resultcode, ptrop, intop) ...@@ -4076,8 +4076,14 @@ cp_pointer_int_sum (resultcode, ptrop, intop)
enum tree_code resultcode; enum tree_code resultcode;
register tree ptrop, intop; register tree ptrop, intop;
{ {
if (!complete_type_or_else (TREE_TYPE (ptrop), ptrop)) tree res_type = TREE_TYPE (ptrop);
return error_mark_node;
/* pointer_int_sum() uses size_in_bytes() on the TREE_TYPE(res_type)
in certain circumstance (when it's valid to do so). So we need
to make sure it's complete. We don't need to check here, if we
can actually complete it at all, as those checks will be done in
pointer_int_sum() anyway. */
complete_type (TREE_TYPE (res_type));
return pointer_int_sum (resultcode, ptrop, fold (intop)); return pointer_int_sum (resultcode, ptrop, fold (intop));
} }
......
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