summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C
blob: 5291181024737653b4dea7a910e250d11cbf0d15 (plain)
1
2
3
4
5
6
7
8
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];
}