Can someone with VC++ 2008 "Orcas" test this?
-
I need someone with Orcas to test the following code. It compiles just fine under Comeau C++ 4.3.9 in strict mode (Comeau is supposedly the "most Standards-compliant compiler in existence") but fails with an error under VS.NET 2003 (VC++). According to the ANSI Standard (section 10.3.5 in my Draft copy), I can't find any reason for it to fail.
// This code fails on VS.NET 2003 (VC++) with a error.
//
// error C2511: 'MyBase2 *MyDerived::Copy(void)' :
// overloaded member function not found in 'MyDerived'
//
// Removing the 'const' qualifiers fixes the problem.class MyBase
{
public:
MyBase() {}
virtual ~MyBase() {}virtual MyBase *Copy() const
{
return new MyBase(*this);
}
};class MyBase2
{
public:
MyBase2() {}
virtual ~MyBase2() {}virtual MyBase2 *Copy() const
{
return new MyBase2(*this);
}
};class MyDerived : public MyBase, public MyBase2
{
public:
MyDerived() {}
virtual ~MyDerived() {}virtual MyDerived *Copy() const
{
return new MyDerived(*this);
}
};int main()
{
return 0;
} -
I need someone with Orcas to test the following code. It compiles just fine under Comeau C++ 4.3.9 in strict mode (Comeau is supposedly the "most Standards-compliant compiler in existence") but fails with an error under VS.NET 2003 (VC++). According to the ANSI Standard (section 10.3.5 in my Draft copy), I can't find any reason for it to fail.
// This code fails on VS.NET 2003 (VC++) with a error.
//
// error C2511: 'MyBase2 *MyDerived::Copy(void)' :
// overloaded member function not found in 'MyDerived'
//
// Removing the 'const' qualifiers fixes the problem.class MyBase
{
public:
MyBase() {}
virtual ~MyBase() {}virtual MyBase *Copy() const
{
return new MyBase(*this);
}
};class MyBase2
{
public:
MyBase2() {}
virtual ~MyBase2() {}virtual MyBase2 *Copy() const
{
return new MyBase2(*this);
}
};class MyDerived : public MyBase, public MyBase2
{
public:
MyDerived() {}
virtual ~MyDerived() {}virtual MyDerived *Copy() const
{
return new MyDerived(*this);
}
};int main()
{
return 0;
} -
I don't have Orcas installed and really don't want to risk messing up my main build environment, which is a pretty delicate setup. Dropping a new compiler on the system is the general equivalent of a tactical nuclear warhead. I want to know if the bug is in Orcas (i.e. emits an incorrect error message). Please, just run it through Orcas and post the output.
-
I need someone with Orcas to test the following code. It compiles just fine under Comeau C++ 4.3.9 in strict mode (Comeau is supposedly the "most Standards-compliant compiler in existence") but fails with an error under VS.NET 2003 (VC++). According to the ANSI Standard (section 10.3.5 in my Draft copy), I can't find any reason for it to fail.
// This code fails on VS.NET 2003 (VC++) with a error.
//
// error C2511: 'MyBase2 *MyDerived::Copy(void)' :
// overloaded member function not found in 'MyDerived'
//
// Removing the 'const' qualifiers fixes the problem.class MyBase
{
public:
MyBase() {}
virtual ~MyBase() {}virtual MyBase *Copy() const
{
return new MyBase(*this);
}
};class MyBase2
{
public:
MyBase2() {}
virtual ~MyBase2() {}virtual MyBase2 *Copy() const
{
return new MyBase2(*this);
}
};class MyDerived : public MyBase, public MyBase2
{
public:
MyDerived() {}
virtual ~MyDerived() {}virtual MyDerived *Copy() const
{
return new MyDerived(*this);
}
};int main()
{
return 0;
}I know you didn't ask, but it works fine in 2005. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
I know you didn't ask, but it works fine in 2005. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
Thanks. I'll just assume it works fine in VS 2008 as well.