===================================================================
@@ -3283,8 +3283,7 @@ build_vec_init (tree base, tree maxindex, tree ini
if (TREE_CODE (atype) == ARRAY_TYPE && TYPE_DOMAIN (atype))
maxindex = array_type_nelts (atype);
- if (maxindex == NULL_TREE || maxindex == error_mark_node
- || integer_all_onesp (maxindex))
+ if (maxindex == NULL_TREE || maxindex == error_mark_node)
return error_mark_node;
if (explicit_value_init_p)
===================================================================
@@ -0,0 +1,22 @@
+// PR c++/55446
+// { dg-do run }
+
+struct S
+{
+ S() { }
+};
+
+int n = 1;
+
+void* operator new[](__SIZE_TYPE__)
+{
+ n = -1;
+ return &n;
+}
+
+int main()
+{
+ new S[0];
+ if (n != -1)
+ __builtin_abort();
+}