B b;
// Verify integer literal.
- p = new char [-1]; // { dg-error "size of array is negative" }
- p = new char [2][-3]; // { dg-error "size of array|narrowing conversion" }
- p = new char [-4][5]; // { dg-error "size of array is negative" }
- p = new char [-6][-7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new (p) char [-1]; // { dg-error "size of array is negative" }
- p = new (p) char [2][-3]; // { dg-error "size of array|narrowing conversion" }
- p = new (p) char [-4][5]; // { dg-error "size of array is negative" }
- p = new (p) char [-6][-7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new (p) A [-1]; // { dg-error "size of array is negative" }
- p = new (p) A [2][-3]; // { dg-error "size of array|narrowing conversion" }
- p = new (p) A [-4][5]; // { dg-error "size of array is negative" }
- p = new (p) A [-6][-7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new (p) B [-1]; // { dg-error "size of array is negative" }
- p = new (p) B [2][-3]; // { dg-error "size of array|narrowing conversion" }
- p = new (p) B [-4][5]; // { dg-error "size of array is negative" }
- p = new (p) B [-6][-7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new (&b) B [-1]; // { dg-error "size of array is negative" }
- p = new (&b) B [2][-3]; // { dg-error "size of array|narrowing conversion" }
- p = new (&b) B [-4][5]; // { dg-error "size of array is negative" }
- p = new (&b) B [-6][-7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new char [1 - 2]; // { dg-error "size of array is negative" }
- p = new (p) char [2 - 3]; // { dg-error "size of array is negative" }
- p = new A [2 < 1 ? -1 : -2]; // { dg-error "size of array is negative" }
- p = new (p) B [2 - 3 * 2]; // { dg-error "size of array is negative" }
- p = new (&b) B [1][2 - 3 * 2];// { dg-error "size of array|narrowing conversion" }
+ p = new char [-1]; // { dg-error "size .-1. of array is negative" }
+ p = new char [2][-3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new char [-4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new char [-6][-7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new (p) char [-1]; // { dg-error "size .-1. of array is negative" }
+ p = new (p) char [2][-3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new (p) char [-4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new (p) char [-6][-7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new (p) A [-1]; // { dg-error "size .-1. of array is negative" }
+ p = new (p) A [2][-3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new (p) A [-4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new (p) A [-6][-7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new (p) B [-1]; // { dg-error "size .-1. of array is negative" }
+ p = new (p) B [2][-3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new (p) B [-4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new (p) B [-6][-7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new (&b) B [-1]; // { dg-error "size .-1. of array is negative" }
+ p = new (&b) B [2][-3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new (&b) B [-4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new (&b) B [-6][-7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new char [1 - 2]; // { dg-error "size .-1. of array is negative" }
+ p = new (p) char [2 - 3]; // { dg-error "size .-1. of array is negative" }
+ p = new A [2 < 1 ? -1 : -2]; // { dg-error "size .-2. of array is negative" }
+ p = new (p) B [2 - 3 * 2]; // { dg-error "size .-4. of array is negative" }
+ p = new (&b) B [1][2 - 3 * 2];// { dg-error "size .-4. of array|narrowing conversion" }
}
void test_constant_expression ()
static const int i7 = -7;
// Verify constant expression.
- p = new char [i1]; // { dg-error "size of array is negative" }
- p = new char [2][i3]; // { dg-error "size of array|narrowing conversion" }
- p = new char [i4][5]; // { dg-error "size of array is negative" }
- p = new char [i6][i7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new (p) char [i1]; // { dg-error "size of array is negative" }
- p = new (p) char [2][i3]; // { dg-error "size of array|narrowing conversion" }
- p = new (p) char [i4][5]; // { dg-error "size of array is negative" }
- p = new (p) char [i6][i7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new (p) A [i1]; // { dg-error "size of array is negative" }
- p = new (p) A [2][i3]; // { dg-error "size of array|narrowing conversion" }
- p = new (p) A [i4][5]; // { dg-error "size of array is negative" }
- p = new (p) A [i6][i7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new (p) B [i1]; // { dg-error "size of array is negative" }
- p = new (p) B [2][i3]; // { dg-error "size of array|narrowing conversion" }
- p = new (p) B [i4][5]; // { dg-error "size of array is negative" }
- p = new (p) B [i6][i7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new (&b) B [i1]; // { dg-error "size of array is negative" }
- p = new (&b) B [2][i3]; // { dg-error "size of array|narrowing conversion" }
- p = new (&b) B [i4][5]; // { dg-error "size of array is negative" }
- p = new (&b) B [i6][i7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new short [i1 - 2]; // { dg-error "size of array is negative" }
- p = new (p) bool [i2 - 3]; // { dg-error "size of array is negative" }
- p = new A [2 < 1 ? i1 : i2]; // { dg-error "size of array is negative" }
- p = new (p) B [2 + i3 * 2]; // { dg-error "size of array is negative" }
- p = new (&b) B [1][i1 - 3 * 2];// { dg-error "size of array|narrowing conversion" }
+ p = new char [i1]; // { dg-error "size .-1. of array is negative" }
+ p = new char [2][i3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new char [i4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new char [i6][i7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new (p) char [i1]; // { dg-error "size .-1. of array is negative" }
+ p = new (p) char [2][i3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new (p) char [i4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new (p) char [i6][i7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new (p) A [i1]; // { dg-error "size .-1. of array is negative" }
+ p = new (p) A [2][i3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new (p) A [i4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new (p) A [i6][i7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new (p) B [i1]; // { dg-error "size .-1. of array is negative" }
+ p = new (p) B [2][i3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new (p) B [i4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new (p) B [i6][i7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new (&b) B [i1]; // { dg-error "size .-1. of array is negative" }
+ p = new (&b) B [2][i3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new (&b) B [i4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new (&b) B [i6][i7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new short [i1 - 2]; // { dg-error "size .-3. of array is negative" }
+ p = new (p) bool [i2 - 3]; // { dg-error "size .-5. of array is negative" }
+ p = new A [2 < 1 ? i1 : i2]; // { dg-error "size .-2. of array is negative" }
+ p = new (p) B [2 + i3 * 2]; // { dg-error "size .-4. of array is negative" }
+ p = new (&b) B [1][i1 - 3 * 2];// { dg-error "size .-7. of array|narrowing conversion" }
}
void test_constexpr ()
#endif
// Verify constant expression.
- p = new char [s1]; // { dg-error "size of array is negative" }
- p = new char [2][s3]; // { dg-error "size of array|narrowing conversion" }
- p = new char [s4][5]; // { dg-error "size of array is negative" }
- p = new char [s6][s7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new (p) char [s1]; // { dg-error "size of array is negative" }
- p = new (p) char [2][s3]; // { dg-error "size of array|narrowing conversion" }
- p = new (p) char [s4][5]; // { dg-error "size of array is negative" }
- p = new (p) char [s6][s7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new (p) A [s1]; // { dg-error "size of array is negative" }
- p = new (p) A [2][s3]; // { dg-error "size of array|narrowing conversion" }
- p = new (p) A [s4][5]; // { dg-error "size of array is negative" }
- p = new (p) A [s6][s7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new (p) B [s1]; // { dg-error "size of array is negative" }
- p = new (p) B [2][s3]; // { dg-error "size of array|narrowing conversion" }
- p = new (p) B [s4][5]; // { dg-error "size of array is negative" }
- p = new (p) B [s6][s7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new (&b) B [s1]; // { dg-error "size of array is negative" }
- p = new (&b) B [2][s3]; // { dg-error "size of array|narrowing conversion" }
- p = new (&b) B [s4][5]; // { dg-error "size of array is negative" }
- p = new (&b) B [s6][s7]; // { dg-error "size of array|narrowing conversion" }
-
- p = new int [s1 + s2]; // { dg-error "size of array is negative" }
- p = new (p) long [2 * s3]; // { dg-error "size of array is negative" }
- p = new A [s2 < s1 ? s1 : s2]; // { dg-error "size of array is negative" }
- p = new (p) B [s7 - s2 * 2]; // { dg-error "size of array is negative" }
- p = new (&b) B [9][s4 - s1 * 2]; // { dg-error "size of array|narrowing conversion" }
+ p = new char [s1]; // { dg-error "size .-1. of array is negative" }
+ p = new char [2][s3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new char [s4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new char [s6][s7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new (p) char [s1]; // { dg-error "size .-1. of array is negative" }
+ p = new (p) char [2][s3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new (p) char [s4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new (p) char [s6][s7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new (p) A [s1]; // { dg-error "size .-1. of array is negative" }
+ p = new (p) A [2][s3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new (p) A [s4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new (p) A [s6][s7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new (p) B [s1]; // { dg-error "size .-1. of array is negative" }
+ p = new (p) B [2][s3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new (p) B [s4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new (p) B [s6][s7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new (&b) B [s1]; // { dg-error "size .-1. of array is negative" }
+ p = new (&b) B [2][s3]; // { dg-error "size .-3. of array|narrowing conversion" }
+ p = new (&b) B [s4][5]; // { dg-error "size .-4. of array is negative" }
+ p = new (&b) B [s6][s7]; // { dg-error "size .-\[67\]. of array|narrowing conversion" }
+
+ p = new int [s1 + s2]; // { dg-error "size .-3. of array is negative" }
+ p = new (p) long [2 * s3]; // { dg-error "size .-6. of array is negative" }
+ p = new A [s2 < s1 ? s1 : s2]; // { dg-error "size .-1. of array is negative" }
+ p = new (p) B [s7 - s2 * 2]; // { dg-error "size .-3. of array is negative" }
+ p = new (&b) B [9][s4 - s1 * 2]; // { dg-error "size .-2. of array|narrowing conversion" }
}
+
+/* Prune out pedantic warnins (turned into errors via -pedantic-errors).
+ { dg-prune-output "size of array is not an integral constant-expressio" } */
static void __attribute__ ((used))
test_one_dim_char_array ()
{
- p = new char [MAX]; // { dg-error "size of array" }
- p = new char [MAX - 1]; // { dg-error "size of array" }
- p = new char [MAX - 2]; // { dg-error "size of array" }
- p = new char [MAX - 99]; // { dg-error "size of array" }
- p = new char [MAX / 2]; // { dg-error "size of array" }
- p = new char [MAX / 2 - 1]; // { dg-error "size of array" }
- p = new char [MAX / 2 - 2]; // { dg-error "size of array" }
+ p = new char [MAX]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX - 99]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid testing the expressions below since whether or not they
// are accepted depends on the precision of size_t (which also
static void __attribute__ ((used))
test_one_dim_short_array ()
{
- p = new short [MAX]; // { dg-error "size of array" }
- p = new short [MAX - 1]; // { dg-error "size of array" }
- p = new short [MAX - 2]; // { dg-error "size of array" }
- p = new short [MAX - 99]; // { dg-error "size of array" }
- p = new short [MAX / 2]; // { dg-error "size of array" }
- p = new short [MAX / 2 - 1]; // { dg-error "size of array" }
- p = new short [MAX / 2 - 2]; // { dg-error "size of array" }
- p = new short [MAX / 2 - 3]; // { dg-error "size of array" }
- p = new short [MAX / 2 - 4]; // { dg-error "size of array" }
- p = new short [MAX / 2 - 5]; // { dg-error "size of array" }
- p = new short [MAX / 2 - 6]; // { dg-error "size of array" }
- p = new short [MAX / 2 - 7]; // { dg-error "size of array" }
- p = new short [MAX / 2 - 8]; // { dg-error "size of array" }
- p = new short [MAX / 4]; // { dg-error "size of array" }
+ p = new short [MAX]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX - 99]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX / 2 - 3]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX / 2 - 4]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX / 2 - 5]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX / 2 - 6]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new short [MAX / 4]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new short [MAX / 4 - 1];
static void __attribute__ ((used))
test_two_dim_char_array ()
{
- p = new char [1][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][MAX - 99]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][MAX / 2]; // { dg-error "size of array" }
- p = new char [1][MAX / 2 - 1]; // { dg-error "size of array" }
- p = new char [1][MAX / 2 - 2]; // { dg-error "size of array" }
+ p = new char [1][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new char [1][MAX / 2 - 3];
p = new char [1][MAX / 2 - 7]; // okay
p = new char [1][MAX / 2 - 8]; // okay
- p = new char [2][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX / 2]; // { dg-error "size of array" }
- p = new char [2][MAX / 2 - 1]; // { dg-error "size of array" }
- p = new char [2][MAX / 2 - 2]; // { dg-error "size of array" }
- p = new char [2][MAX / 2 - 7]; // { dg-error "size of array" }
- p = new char [2][MAX / 2 - 8]; // { dg-error "size of array" }
-
- p = new char [MAX][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new char [MAX][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new char [MAX][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new char [MAX][MAX / 2]; // { dg-error "size of array" }
- p = new char [MAX][MAX / 2 - 1]; // { dg-error "size of array" }
- p = new char [MAX][MAX / 2 - 2]; // { dg-error "size of array" }
- p = new char [MAX][MAX / 2 - 7]; // { dg-error "size of array" }
- p = new char [MAX][MAX / 2 - 8]; // { dg-error "size of array" }
- p = new char [MAX][2]; // { dg-error "size of array" }
- p = new char [MAX][1]; // { dg-error "size of array" }
- p = new char [MAX / 2][1]; // { dg-error "size of array" }
- p = new char [MAX / 2 - 1][1]; // { dg-error "size of array" }
- p = new char [MAX / 2 - 2][1]; // { dg-error "size of array" }
+ p = new char [2][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of array" }
+
+ p = new char [MAX][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [MAX][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [MAX][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [MAX][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX][1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2][1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 1][1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 2][1]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new char [MAX / 2 - 3][1];
static __attribute__ ((used)) void
test_three_dim_char_array ()
{
- p = new char [1][1][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][1][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][1][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][1][MAX - 99]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][1][MAX / 2]; // { dg-error "size of array" }
- p = new char [1][1][MAX / 2 - 1]; // { dg-error "size of array" }
- p = new char [1][1][MAX / 2 - 2]; // { dg-error "size of array" }
+ p = new char [1][1][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][1][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][1][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][1][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][1][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [1][1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [1][1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new char [1][1][MAX / 2 - 3];
p = new char [1][1][MAX / 2 - 7]; // okay
p = new char [1][1][MAX / 2 - 8]; // okay
- p = new char [1][2][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][2][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][2][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][2][MAX - 99]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][2][MAX / 2]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][2][MAX / 2 - 1]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][2][MAX / 2 - 2]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][2][MAX / 2 - 3]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][2][MAX / 2 - 4]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][2][MAX / 2 - 5]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][2][MAX / 2 - 6]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][2][MAX / 2 - 7]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][2][MAX / 2 - 8]; // { dg-error "size of (unnamed )?array" }
- p = new char [1][2][MAX / 4]; // { dg-error "size of array" }
+ p = new char [1][2][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][2][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][2][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][2][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][2][MAX / 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][2][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][2][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][2][MAX / 2 - 3]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][2][MAX / 2 - 4]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][2][MAX / 2 - 5]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][2][MAX / 2 - 6]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][2][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][2][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [1][2][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new char [1][2][MAX / 4 - 1];
p = new char [1][2][MAX / 4 - 3]; // okay
p = new char [1][2][MAX / 4 - 4]; // okay
- p = new char [2][1][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][1][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][1][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][1][MAX - 99]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][1][MAX / 2]; // { dg-error "size of array" }
- p = new char [2][1][MAX / 2 - 1]; // { dg-error "size of array" }
- p = new char [2][1][MAX / 2 - 2]; // { dg-error "size of array" }
- p = new char [2][1][MAX / 2 - 3]; // { dg-error "size of array" }
- p = new char [2][1][MAX / 2 - 4]; // { dg-error "size of array" }
- p = new char [2][1][MAX / 2 - 5]; // { dg-error "size of array" }
- p = new char [2][1][MAX / 2 - 6]; // { dg-error "size of array" }
- p = new char [2][1][MAX / 2 - 7]; // { dg-error "size of array" }
- p = new char [2][1][MAX / 2 - 8]; // { dg-error "size of array" }
- p = new char [2][1][MAX / 4]; // { dg-error "size of array" }
+ p = new char [2][1][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][1][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][1][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][1][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][1][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][1][MAX / 2 - 3]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][1][MAX / 2 - 4]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][1][MAX / 2 - 5]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][1][MAX / 2 - 6]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][1][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][1][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][1][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new char [2][1][MAX / 4 - 1];
p = new char [2][1][MAX / 4 - 3]; // okay
p = new char [2][1][MAX / 4 - 4]; // okay
- p = new char [2][2][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][2][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][2][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][2][MAX - 99]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][2][MAX / 2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][2][MAX / 2 - 1]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][2][MAX / 2 - 2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][2][MAX / 2 - 3]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][2][MAX / 2 - 4]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][2][MAX / 2 - 5]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][2][MAX / 2 - 6]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][2][MAX / 2 - 7]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][2][MAX / 2 - 8]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][2][MAX / 4]; // { dg-error "size of array" }
- p = new char [2][2][MAX / 4 - 1]; // { dg-error "size of array" }
- p = new char [2][2][MAX / 4 - 2]; // { dg-error "size of array" }
+ p = new char [2][2][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][2][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][2][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][2][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][2][MAX / 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][2][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][2][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][2][MAX / 2 - 3]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][2][MAX / 2 - 4]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][2][MAX / 2 - 5]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][2][MAX / 2 - 6]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][2][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][2][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][2][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][2][MAX / 4 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][2][MAX / 4 - 2]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new char [2][2][MAX / 8];
p = new char [2][2][MAX / 8 - 2];
p = new char [2][2][MAX / 8 - 3];
- p = new char [2][MAX][2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX - 1][2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX - 2][2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX - 99][2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX / 2][2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX / 2 - 1][2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX / 2 - 2][2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX / 2 - 3][2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX / 2 - 4][2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX / 2 - 5][2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX / 2 - 6][2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX / 2 - 7][2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX / 2 - 8][2]; // { dg-error "size of (unnamed )?array" }
- p = new char [2][MAX / 4][2]; // { dg-error "size of array" }
- p = new char [2][MAX / 4 - 1][2]; // { dg-error "size of array" }
- p = new char [2][MAX / 4 - 2][2]; // { dg-error "size of array" }
+ p = new char [2][MAX][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX - 1][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX - 2][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX - 99][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX / 2][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX / 2 - 1][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX / 2 - 2][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX / 2 - 3][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX / 2 - 4][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX / 2 - 5][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX / 2 - 6][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX / 2 - 7][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX / 2 - 8][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [2][MAX / 4][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][MAX / 4 - 1][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [2][MAX / 4 - 2][2]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new char [2][MAX / 8][2];
p = new char [2][MAX / 8 - 2][2];
p = new char [2][MAX / 8 - 3][2];
- p = new char [MAX][2][2]; // { dg-error "size of array" }
- p = new char [MAX - 1][2][2]; // { dg-error "size of array" }
- p = new char [MAX - 2][2][2]; // { dg-error "size of array" }
- p = new char [MAX - 99][2][2]; // { dg-error "size of array" }
- p = new char [MAX / 2][2][2]; // { dg-error "size of array" }
- p = new char [MAX / 2 - 1][2][2]; // { dg-error "size of array" }
- p = new char [MAX / 2 - 2][2][2]; // { dg-error "size of array" }
- p = new char [MAX / 2 - 3][2][2]; // { dg-error "size of array" }
- p = new char [MAX / 2 - 4][2][2]; // { dg-error "size of array" }
- p = new char [MAX / 2 - 5][2][2]; // { dg-error "size of array" }
- p = new char [MAX / 2 - 6][2][2]; // { dg-error "size of array" }
- p = new char [MAX / 2 - 7][2][2]; // { dg-error "size of array" }
- p = new char [MAX / 2 - 8][2][2]; // { dg-error "size of array" }
- p = new char [MAX / 4][2][2]; // { dg-error "size of array" }
- p = new char [MAX / 4 - 1][2][2]; // { dg-error "size of array" }
- p = new char [MAX / 4 - 2][2][2]; // { dg-error "size of array" }
+ p = new char [MAX][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX - 1][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX - 2][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX - 99][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 1][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 2][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 3][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 4][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 5][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 6][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 7][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 2 - 8][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 4][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 4 - 1][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [MAX / 4 - 2][2][2]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new char [MAX / 8][2][2];
p = new char [MAX / 8 - 2][2][2];
p = new char [MAX / 8 - 3][2][2];
- p = new char [MAX][MAX][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new char [MAX][MAX][MAX / 2]; // { dg-error "size of (unnamed )?array" }
- p = new char [MAX][MAX / 2][MAX]; // { dg-error "size of (unnamed )?array" }
+ p = new char [MAX][MAX][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [MAX][MAX][MAX / 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new char [MAX][MAX / 2][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
p = new char [MAX][MAX / 2][MAX / 2]; // { dg-error "size of (unnamed )?array" }
p = new char [MAX / 2][MAX / 2][MAX / 2]; // { dg-error "size of (unnamed )?array" }
}
p = new char [N][N][N][N][N][N][N];
p = new char [N / 2][2][N][N][N][N][N][N];
p = new char [N - 1][N / 2][N][N][N][N][N][N];
- p = new char [N / 2][N][N][N][N][N][N][N]; // { dg-error "size of array" }
- p = new char [N - 1][N][N][N][N][N][N][N]; // { dg-error "size of array" }
- p = new char [N] [N][N][N][N][N][N][N]; // { dg-error "size of array" }
+ p = new char [N / 2][N][N][N][N][N][N][N]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [N - 1][N][N][N][N][N][N][N]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new char [N] [N][N][N][N][N][N][N]; // { dg-error "size .\[0-9\]+. of array" }
}
typedef struct Byte {
static void __attribute__ ((used))
test_one_dim_byte_array (void *p)
{
- p = new (p) B [MAX]; // { dg-error "size of array" }
- p = new (p) B [MAX - 1]; // { dg-error "size of array" }
- p = new (p) B [MAX - 2]; // { dg-error "size of array" }
- p = new (p) B [MAX - 99]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2 - 1]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2 - 2]; // { dg-error "size of array" }
+ p = new (p) B [MAX]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX - 99]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid testing the expressions below since whether or not they
// are accepted depends on the precision of size_t (which determines
- // the size of the cookie).
+ // the size .\[0-9\]+. of the cookie).
// p = new (p) B [MAX / 2 - 3];
// p = new (p) B [MAX / 2 - 4];
// p = new (p) B [MAX / 2 - 5];
static void __attribute__ ((used))
test_placement_two_dim_byte_struct_array (void *p)
{
- p = new (p) B [1][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][MAX - 99]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][MAX / 2]; // { dg-error "size of array" }
- p = new (p) B [1][MAX / 2 - 1]; // { dg-error "size of array" }
- p = new (p) B [1][MAX / 2 - 2]; // { dg-error "size of array" }
+ p = new (p) B [1][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new (p) B [1][MAX / 2 - 3];
p = new (p) B [1][MAX / 2 - 7]; // okay
p = new (p) B [1][MAX / 2 - 8]; // okay
- p = new (p) B [2][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX / 2]; // { dg-error "size of array" }
- p = new (p) B [2][MAX / 2 - 1]; // { dg-error "size of array" }
- p = new (p) B [2][MAX / 2 - 2]; // { dg-error "size of array" }
- p = new (p) B [2][MAX / 2 - 7]; // { dg-error "size of array" }
- p = new (p) B [2][MAX / 2 - 8]; // { dg-error "size of array" }
-
- p = new (p) B [MAX][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [MAX][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [MAX][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [MAX][MAX / 2]; // { dg-error "size of array" }
- p = new (p) B [MAX][MAX / 2 - 1]; // { dg-error "size of array" }
- p = new (p) B [MAX][MAX / 2 - 2]; // { dg-error "size of array" }
- p = new (p) B [MAX][MAX / 2 - 7]; // { dg-error "size of array" }
- p = new (p) B [MAX][MAX / 2 - 8]; // { dg-error "size of array" }
- p = new (p) B [MAX][2]; // { dg-error "size of array" }
- p = new (p) B [MAX][1]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2][1]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2 - 1][1]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2 - 2][1]; // { dg-error "size of array" }
+ p = new (p) B [2][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of array" }
+
+ p = new (p) B [MAX][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [MAX][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [MAX][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [MAX][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX][1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2][1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 1][1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 2][1]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new (p) B [MAX / 2 - 3][1];
static __attribute__ ((used)) void
test_placement_three_dim_byte_struct_array (void *p)
{
- p = new (p) B [1][1][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][1][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][1][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][1][MAX - 99]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][1][MAX / 2]; // { dg-error "size of array" }
- p = new (p) B [1][1][MAX / 2 - 1]; // { dg-error "size of array" }
- p = new (p) B [1][1][MAX / 2 - 2]; // { dg-error "size of array" }
+ p = new (p) B [1][1][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][1][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][1][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][1][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][1][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [1][1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [1][1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new (p) B [1][1][MAX / 2 - 3];
p = new (p) B [1][1][MAX / 2 - 7]; // okay
p = new (p) B [1][1][MAX / 2 - 8]; // okay
- p = new (p) B [1][2][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][2][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][2][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][2][MAX - 99]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][2][MAX / 2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][2][MAX / 2 - 1]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][2][MAX / 2 - 2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][2][MAX / 2 - 3]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][2][MAX / 2 - 4]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][2][MAX / 2 - 5]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][2][MAX / 2 - 6]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][2][MAX / 2 - 7]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][2][MAX / 2 - 8]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [1][2][MAX / 4]; // { dg-error "size of array" }
+ p = new (p) B [1][2][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][2][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][2][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][2][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][2][MAX / 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][2][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][2][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][2][MAX / 2 - 3]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][2][MAX / 2 - 4]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][2][MAX / 2 - 5]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][2][MAX / 2 - 6]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][2][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][2][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [1][2][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new (p) B [1][2][MAX / 4 - 1];
p = new (p) B [1][2][MAX / 4 - 3]; // okay
p = new (p) B [1][2][MAX / 4 - 4]; // okay
- p = new (p) B [2][1][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][1][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][1][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][1][MAX - 99]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][1][MAX / 2]; // { dg-error "size of array" }
- p = new (p) B [2][1][MAX / 2 - 1]; // { dg-error "size of array" }
- p = new (p) B [2][1][MAX / 2 - 2]; // { dg-error "size of array" }
- p = new (p) B [2][1][MAX / 2 - 3]; // { dg-error "size of array" }
- p = new (p) B [2][1][MAX / 2 - 4]; // { dg-error "size of array" }
- p = new (p) B [2][1][MAX / 2 - 5]; // { dg-error "size of array" }
- p = new (p) B [2][1][MAX / 2 - 6]; // { dg-error "size of array" }
- p = new (p) B [2][1][MAX / 2 - 7]; // { dg-error "size of array" }
- p = new (p) B [2][1][MAX / 2 - 8]; // { dg-error "size of array" }
- p = new (p) B [2][1][MAX / 4]; // { dg-error "size of array" }
+ p = new (p) B [2][1][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][1][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][1][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][1][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][1][MAX / 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][1][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][1][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][1][MAX / 2 - 3]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][1][MAX / 2 - 4]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][1][MAX / 2 - 5]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][1][MAX / 2 - 6]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][1][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][1][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][1][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new (p) B [2][1][MAX / 4 - 1];
p = new (p) B [2][1][MAX / 4 - 3]; // okay
p = new (p) B [2][1][MAX / 4 - 4]; // okay
- p = new (p) B [2][2][MAX]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][2][MAX - 1]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][2][MAX - 2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][2][MAX - 99]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][2][MAX / 2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][2][MAX / 2 - 1]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][2][MAX / 2 - 2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][2][MAX / 2 - 3]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][2][MAX / 2 - 4]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][2][MAX / 2 - 5]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][2][MAX / 2 - 6]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][2][MAX / 2 - 7]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][2][MAX / 2 - 8]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][2][MAX / 4]; // { dg-error "size of array" }
- p = new (p) B [2][2][MAX / 4 - 1]; // { dg-error "size of array" }
- p = new (p) B [2][2][MAX / 4 - 2]; // { dg-error "size of array" }
+ p = new (p) B [2][2][MAX]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][2][MAX - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][2][MAX - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][2][MAX - 99]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][2][MAX / 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][2][MAX / 2 - 1]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][2][MAX / 2 - 2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][2][MAX / 2 - 3]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][2][MAX / 2 - 4]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][2][MAX / 2 - 5]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][2][MAX / 2 - 6]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][2][MAX / 2 - 7]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][2][MAX / 2 - 8]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][2][MAX / 4]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][2][MAX / 4 - 1]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][2][MAX / 4 - 2]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new (p) B [2][2][MAX / 8];
p = new (p) B [2][2][MAX / 8 - 2];
p = new (p) B [2][2][MAX / 8 - 3];
- p = new (p) B [2][MAX][2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX - 1][2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX - 2][2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX - 99][2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX / 2][2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX / 2 - 1][2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX / 2 - 2][2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX / 2 - 3][2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX / 2 - 4][2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX / 2 - 5][2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX / 2 - 6][2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX / 2 - 7][2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX / 2 - 8][2]; // { dg-error "size of (unnamed )?array" }
- p = new (p) B [2][MAX / 4][2]; // { dg-error "size of array" }
- p = new (p) B [2][MAX / 4 - 1][2]; // { dg-error "size of array" }
- p = new (p) B [2][MAX / 4 - 2][2]; // { dg-error "size of array" }
+ p = new (p) B [2][MAX][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX - 1][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX - 2][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX - 99][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX / 2][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX / 2 - 1][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX / 2 - 2][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX / 2 - 3][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX / 2 - 4][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX / 2 - 5][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX / 2 - 6][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX / 2 - 7][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX / 2 - 8][2]; // { dg-error "size .\[0-9\]+. of (unnamed )?array" }
+ p = new (p) B [2][MAX / 4][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][MAX / 4 - 1][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [2][MAX / 4 - 2][2]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new (p) B [2][MAX / 8][2];
p = new (p) B [2][MAX / 8 - 2][2];
p = new (p) B [2][MAX / 8 - 3][2];
- p = new (p) B [MAX][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX - 1][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX - 2][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX - 99][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2 - 1][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2 - 2][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2 - 3][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2 - 4][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2 - 5][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2 - 6][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2 - 7][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX / 2 - 8][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX / 4][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX / 4 - 1][2][2]; // { dg-error "size of array" }
- p = new (p) B [MAX / 4 - 2][2][2]; // { dg-error "size of array" }
+ p = new (p) B [MAX][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX - 1][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX - 2][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX - 99][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 1][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 2][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 3][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 4][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 5][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 6][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 7][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 2 - 8][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 4][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 4 - 1][2][2]; // { dg-error "size .\[0-9\]+. of array" }
+ p = new (p) B [MAX / 4 - 2][2][2]; // { dg-error "size .\[0-9\]+. of array" }
// Avoid exercising data model-dependent expressions.
// p = new (p) B [MAX / 8][2][2];