[Bug c++/83808] [7/8 Regression] "internal compiler error" for invalid input

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 17 12:13:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83808

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
--- gcc/cp/tree.c.jj    2018-01-17 11:54:08.669802704 +0100
+++ gcc/cp/tree.c       2018-01-17 13:11:08.524278851 +0100
@@ -1044,11 +1044,14 @@ array_of_runtime_bound_p (tree t)
   if (!t || TREE_CODE (t) != ARRAY_TYPE)
     return false;
   tree dom = TYPE_DOMAIN (t);
-  if (!dom)
-    return false;
-  tree max = TYPE_MAX_VALUE (dom);
-  return (!potential_rvalue_constant_expression (max)
-         || (!value_dependent_expression_p (max) && !TREE_CONSTANT (max)));
+  if (dom)
+    {
+      tree max = TYPE_MAX_VALUE (dom);
+      if (!potential_rvalue_constant_expression (max)
+         || (!value_dependent_expression_p (max) && !TREE_CONSTANT (max)))
+       return true;
+    }
+  return array_of_runtime_bound_p (TREE_TYPE (t));
 }

 /* Return a reference type node referring to TO_TYPE.  If RVAL is

isn't sufficient either though.


More information about the Gcc-bugs mailing list