Баги MSVC 7.1
От: johny5 Новая Зеландия
Дата: 25.09.06 07:01
Оценка: 8 (2)
Два новых (надеюсь не пролетало) бага.


struct Base
{
protected:
    bool Method();
};

struct Derived : public Base
{
    using Base::Method;
};

void f()
{
    bool (Derived::*MPtr)() = &Derived::Method;
}


Результат: error C2248: 'Base::Method' : cannot access protected member declared in class 'Base'


И на том же месте ещё один:


struct Bebe
{
    template<typename T>
    Bebe(T* ptr, bool (T::*mptr)())
    {}
};

struct Base
{
    bool Method();
};

struct Derived : public Base
{
};

void f()
{
    Derived test;
    Bebe b(&test, &Derived::Method);    //1

    //bool (Derived::*MPtr)() = &Derived::Method;    //2
    //Bebe b(&test, MPtr);                //2
}


Результат: error C2660: 'Bebe::Bebe' : function does not take 2 arguments
Если поменять 1 на 2, то скомпиляется.

В Comeau проверял обе ситуации — компиляется.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.