[omniORB] MSVC 6.0 bug with inheritance across namespaces (mo dules)

Swayamjit Das swayam@krdl.org.sg
Tue, 04 Aug 1998 09:33:39 +0800


hi,
     The MSVC bug pointed out is for real. Pl. try the following code. It
throws a stackoverflow exception.
     I am using MSVC 5.0+sp3.

///////////////////////////////////////////////////////////////////////////////////////////////////

namespace X
{
    class A
    {
    public:
        virtual void func();
    };

    class B: public A
    {
    public:
        virtual void func();
    };
};

namespace Y
{
    class A: public X::A
    {
    public:
        virtual void func();
    };
};

typedef X::A X_A ;

void doit(){}
void X::A::func(){ doit();}
void X::B::func(){X_A::func();((X_A *)this)->X_A::func();}
void Y::A::func(){X_A::func();((X_A *)this)->X_A::func();}

void main()
{
    Y::A t; t.func();
}
///////////////////////////////////////////////////////////////////////////////////////////////////

Thanks

SDas.