summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/init16.C
blob: de4c0ad9717fa49a807b013878193ff9d0995837 (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
// { dg-do run  }
// Origin: Jakub Jelinek <jakub@redhat.com>

struct bar {
  char c;
  bar (const char *);
  bar (const bar &);
};

struct foo {
  bar x;
};

extern const struct foo y = { "foo" };

bar::bar (const bar &ref)
{
  c = ref.c;
}

bar::bar (const char *p)
{
  c = p[2];
}

int main ()
{
  return y.x.c != 'o';
}