diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C')
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C new file mode 100644 index 000000000..529118102 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wstrict-aliasing -fstrict-aliasing" } */ + +int foo () { + int buffer[10][10]; + int* pi = &buffer[0][0]; /* { dg-bogus "same element type" } */ + *pi = 10; + return buffer[0][0]; +} |