Using destructor bug (VC2008SP1)

Back to Compiler bugs

It is not essential that the Base is a dependent type. However, this represents the normal use-case better.

class C
{
};

class A
{
public:
    typedef C B;
};

template <typename Base>
class Derived
    : public Base
{
public:
    using typename Base::B;

    Derived()
    {
        b->~B();
    }

private:
    B* b;
};

int main()
{
    Derived<A> d;

    return 0;
}