Comeau 4.2.44 - 4.3.10.1 Beta bug

Back to programming

// An older version 4.2.43 compiles this correctly.

template <typename Type>
class A
{
public:
    typedef int SomeType;
};

template <typename Type>
class B
    : public A<Type>
{
public:
    // Because the base class
    // is dependent on a template parameter,
    // nothing is visible by default.
    // A using declaration is needed
    // to make 'SomeType' visible.
    using A<Type>::SomeType;

    void f()
    {
        // But the Comeau compiler
        // still can not see 'SomeType'.
        SomeType a = 2;
    }
};

int main()
{
    B<int> b;
    b.f();

    return 0;
}