summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/copy5.C
blob: cef5a2950ef170e531ac8dae6b2538a057adf582 (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-options "-O2" }

struct BOOL {
    int nVal:1, bSet:1;
    BOOL (int i) : nVal(i!=0), bSet(1) {}
};
struct Fill {
    void *d;
    Fill() : d(0) {}
    Fill( const Fill& ) {}
};
struct SvMetaSlot {
    Fill aGroupId;
    BOOL a8;
    SvMetaSlot() :
      a8(1) {}
    SvMetaSlot* MakeClone() const;
};

SvMetaSlot* SvMetaSlot::MakeClone() const { return new SvMetaSlot( *this ); }

extern "C" void abort(void);
int main()
{
  SvMetaSlot s; SvMetaSlot s2(s);
  if (s.a8.bSet != s2.a8.bSet)
    abort ();
  return 0;
}