3 // Copyright (C) 2001 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 31 Jul 2001 <nathan@codesourcery.com>
6 // Bug 3820. We were bit copying empty bases including the
7 // padding. Which clobbers whatever they overlay.
11 struct Inter : Empty {};
19 NonPod () {m = 0x12345678;}
20 NonPod (long m_) {m = m_;}
21 NonPod &operator= (NonPod const &src) {now = m; m = src.m; return *this;}
22 NonPod (NonPod const &src) {m = src.m;}
40 struct C : NonPod, Inter
42 C (long c) : NonPod (c), Inter () {}
54 return 1; // we copied the empty base which clobbered a.m.m's
58 *(Inter *)&a = *(Inter *)&b;
60 if (a.m.m != 0x22232425)
61 return 2; // we copied padding, which clobbered a.m.m
64 (Inter &)b2 = Inter ();
65 if (b2.m.m != 0x32333435)
66 return 2; // we copied padding, which clobbered b2.m.m
77 if (c.m.m != 0x22232425)
82 if (e.m != 0x32333435)
83 return 2; // we copied padding