------- Comment #4 from pinskia at gcc dot gnu dot org  2007-06-05 20:39 -------
This patch is incorrect and just wrong, the C++ front-end should be catching
this before calling size_binop.  Also the code is invalid so we should have an
error.
This patch also allows us to get around the ICE (but still does not provide an
error):
Index: /home/apinski/src/gcc-fsf/pointerplusexpr/gcc/gcc/cp/tree.c
===================================================================
--- /home/apinski/src/gcc-fsf/pointerplusexpr/gcc/gcc/cp/tree.c (revision
125291)
+++ /home/apinski/src/gcc-fsf/pointerplusexpr/gcc/gcc/cp/tree.c (working copy)
@@ -1415,8 +1415,11 @@ cxx_print_statistics (void)
 tree
 array_type_nelts_top (tree type)
 {
+  tree tmp = array_type_nelts (type);
+  if (tmp == error_mark_node)
+    return error_mark_node;
   return fold_build2 (PLUS_EXPR, sizetype,
-                     array_type_nelts (type),
+                     tmp,
                      integer_one_node);
 }


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-06-05 20:39:08
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31743

Reply via email to