summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/pr68270.C
blob: 441fca3e85fd97c749c117c73a4e248e28055e91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* PR71633 */
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */
/* { dg-options "-Werror=chkp -mmpx -fcheck-pointer-bounds -O1 -fchkp-flexible-struct-trailing-arrays" } */

struct a
{
  struct
  {
    int e[1];
  } f;
};

int g(a *ptr)
{
  return ptr->f.e[1];
}