Is this there a defined behavior for this code that deletes a derived class through a base class pointer?
<p>Does this code result in defined behavior?</p>

<pre><code>class A {
    int x;
};
class B {
    short y;
};
class C {
    double z;
};

class D : public A, public B, public C {
    float bouncy;
};

void deleteB(B *b) {
    delete b;
}

void is_it_defined() {
    D *d = new D;
    deleteB(d);

    B *b = new D;  // Is this any different?
    delete b;
}
</code></pre>

<p>If it's not defined, why not?  And if it is, what's it defined to do and why?  Lastly, if it's implementation defined, could you give an example of what a common implementation might define the behavior to be?</p>
