]> gcc.gnu.org Git - gcc.git/commitdiff
typeck.c (cp_pointer_int_sum): Complete inner type which is used later by size_in_byt...
authorMichael Matz <matz@suse.de>
Fri, 1 Mar 2002 13:50:28 +0000 (13:50 +0000)
committerMichael Matz <matz@gcc.gnu.org>
Fri, 1 Mar 2002 13:50:28 +0000 (13:50 +0000)
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

gcc/cp/ChangeLog
gcc/cp/typeck.c

index 46d6b3fdd9311ae9b548b0811e1a4b4c7aa942b3..f1c25a4d4ff5b48da6921c52fbcf805c417f250e 100644 (file)
@@ -1,3 +1,8 @@
+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>
 
        * cp-tree.h:  Require __GNUC__ to be #defined.
index 6ca524233d8d6aa5b2dbd0395fb98077ede54aae..e5f643c72d8d49a861c8feea03f386b8584d4bcb 100644 (file)
@@ -4076,8 +4076,14 @@ cp_pointer_int_sum (resultcode, ptrop, intop)
      enum tree_code resultcode;
      register tree ptrop, intop;
 {
-  if (!complete_type_or_else (TREE_TYPE (ptrop), ptrop))
-    return error_mark_node;
+  tree res_type = TREE_TYPE (ptrop);
+
+  /* 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));
 }
This page took 0.083009 seconds and 5 git commands to generate.