FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.dg / init / empty1.C
blobbba179f987b3227142d148b0e2abaa1f1d7aca3c
1 // { dg-do run }
3 // Copyright (C) 2001 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 3 Sept 2001 <nathan@codesourcery.com>
6 // Bug 4203. We were bit copying empty bases including the
7 // padding. Which clobbers whatever they overlay.
9 class EmptyBase0 {};
10 class EmptyBase1 : public EmptyBase0 {};
11 class Base1
13 public:
14 unsigned int t_;
15 Base1(unsigned int t) : t_(t) {}
18 class PEPE : public Base1, public EmptyBase1
20 public:
21 PEPE(unsigned int t)
22   : Base1(t), EmptyBase1(EmptyBase1()) {}
25 int main()
27   PEPE pepe(0xff);
28   
29   return pepe.t_ != 255;