summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/pr18968.C
blob: cce73b5797121b0196d4610f640675969d917f8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// { dg-do compile }
// { dg-options "-O1" }
struct X
{
  int i;
};
struct Y : virtual X {};
struct Z : Y {};
struct A
{
  Z* p;
  A();
};
A::A() : p(0)
{
  ((X*)(Y*)p)->i++;
}