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.