| 1 |
// { dg-do run } |
| 2 |
|
| 3 |
// Copyright (C) 2001 Free Software Foundation, Inc. |
| 4 |
// Contributed by Nathan Sidwell 3 Sept 2001 <[email protected]> |
| 5 |
|
| 6 |
// Bug 4203. We were bit copying empty bases including the |
| 7 |
// padding. Which clobbers whatever they overlay. |
| 8 |
|
| 9 |
class EmptyBase0 {}; |
| 10 |
class EmptyBase1 : public EmptyBase0 {}; |
| 11 |
class Base1 |
| 12 |
{ |
| 13 |
public: |
| 14 |
unsigned int t_; |
| 15 |
Base1(unsigned int t) : t_(t) {} |
| 16 |
}; |
| 17 |
|
| 18 |
class PEPE : public Base1, public EmptyBase1 |
| 19 |
{ |
| 20 |
public: |
| 21 |
PEPE(unsigned int t) |
| 22 |
: Base1(t), EmptyBase1(EmptyBase1()) {} |
| 23 |
}; |
| 24 |
|
| 25 |
int main() |
| 26 |
{ |
| 27 |
PEPE pepe(0xff); |
| 28 |
|
| 29 |
return pepe.t_ != 255; |
| 30 |
} |