gcc/testsuite/g++.dg/init/new35.C
raw| 1 | // { dg-do compile } |
| 2 | // { dg-options "" } |
| 3 | |
| 4 | int |
| 5 | main (int argc, char **argv) |
| 6 | { |
| 7 | typedef char A[argc]; |
| 8 | new A; // { dg-warning "array" } |
| 9 | new A[0]; // { dg-error "must be constant|not a constant" } |
| 10 | new A[5]; // { dg-error "must be constant|not a constant" } |
| 11 | new (A[0]); // { dg-error "must be constant|not a constant" } |
| 12 | new (A[5]); // { dg-error "must be constant|not a constant" } |
| 13 | } |