summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/copy5.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/init/copy5.C')
-rw-r--r--gcc/testsuite/g++.dg/init/copy5.C29
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/init/copy5.C b/gcc/testsuite/g++.dg/init/copy5.C
new file mode 100644
index 000000000..cef5a2950
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/copy5.C
@@ -0,0 +1,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;
+}