www.digitalmars.com         C & C++   DMDScript  

c++ - A couple of using-declaration bugs

Hi, I've found a couple of bugs with the latest version (8.50) of DMC.  They
can be reproduced as follows:

First, DMC doesn't allow using-declarations to modify the access rights of
member function templates:

class base
{
protected:
    template <typename T>
    void f(T);
};

class derived : base
{
public:
    using base::f;
};

void g()
{
    derived d;
    d.f(5); // Error: member 'base::f' of class 'derived' is not accessible
}

Second, the compiler fails to parse the following construct:

template <typename T>
class base
{
protected:
    void f();
};

class derived : base<int>
{
public:
    using base<int>::f; // Error: using-declaration cannot name template-id
'base'
};

The latter bug is easily worked-around by using a typedef, however.

Thanks for your time, and for your compiler! :-)
Feb 07 2008