#define THREE

struct Base {
  int t_size;
  Base (int i) : t_size(i) {}
  virtual ~Base () {}
  int size () const { return t_size; };
};

struct D1 : virtual Base {
  int a[10];
  D1 () : Base(0) {}
  ~D1 () {}
};
struct D2 : virtual Base {
  int a[20];
  D2() : Base(0) {}
  ~D2 () {}
};

#ifdef ONE
struct Derived : Base
#endif
#ifdef TWO
struct Derived : virtual Base
#endif
#ifdef THREE
struct Derived : D1, D2
#endif
{
  Derived () : Base(0) {}
  ~Derived () {}
  int a[100];
};


void foo (Derived *p) 
{
  if(p->size())
    return;
  p = 0;
}

int main ()
{
  Derived d;
  foo(&d);
}
