Debian Codegraph @

gcc/testsuite/g++.dg/init/copy5.C

raw
1 // { dg-do run }
2 // { dg-options "-O2" }
3
4 struct BOOL {
5 int nVal:1, bSet:1;
6 BOOL (int i) : nVal(i!=0), bSet(1) {}
7 };
8 struct Fill {
9 void *d;
10 Fill() : d(0) {}
11 Fill( const Fill& ) {}
12 };
13 struct SvMetaSlot {
14 Fill aGroupId;
15 BOOL a8;
16 SvMetaSlot() :
17 a8(1) {}
18 SvMetaSlot* MakeClone() const;
19 };
20
21 SvMetaSlot* SvMetaSlot::MakeClone() const { return new SvMetaSlot( *this ); }
22
23 extern "C" void abort(void);
24 int main()
25 {
26 SvMetaSlot s; SvMetaSlot s2(s);
27 if (s.a8.bSet != s2.a8.bSet)
28 abort ();
29 return 0;
30 }