summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/tree-ssa/pr22488.C
blob: 9063b067a5202f74c4badb6b3b1a94d6b72ab18f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// PR tree-optimization/22488
// This testcase is really a C++ FE bug in represnting virtual inheritance
// It gives the appearance to the middle end that the fields exist twice
// which resulted in a very confused structure analyzer
// { dg-do compile }
// { dg-options "-O" }
struct X
{
    int i0, i1;
      char c;
};

struct A
{
    int i;
      char c0, c1;

        virtual ~A();
};

struct B : virtual A {};

struct C : B
{
    X x;

      void bar(X y) { x = y; }
};

void foo()
{
    C().bar(X());
}