diff options
Diffstat (limited to 'gcc/testsuite/c-c++-common/array-lit.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/array-lit.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/array-lit.c b/gcc/testsuite/c-c++-common/array-lit.c new file mode 100644 index 0000000..6505c20 --- /dev/null +++ b/gcc/testsuite/c-c++-common/array-lit.c @@ -0,0 +1,12 @@ +/* { dg-options "-std=c99 -Wc++-compat -Werror" { target c } } */ +/* { dg-prune-output "treated as errors" } */ +#include <stdio.h> + +int main() +{ + for (int *p = (int[]){ 1, 2, 3, 0 }; /* { dg-error "array" } */ + *p; ++p) { + printf("%d\n", *p); + } + return 0; +} |