Using declaration bug (VC2008SP1)

Back to Compiler bugs

class Base
{
public:
    enum {VALUE = 2};
};

class Derived
    : public Base
{
public:
    // If you comment this, this will compile.
    using Base::VALUE;
};

template <int N>
class Something {};

template <typename T>
Something<T::VALUE> f(T& that)
{
    return Something<T::VALUE>();
}

int main()
{
    Derived derived;
    f(derived);
    return 0;
}