This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: c++/4122


After thinking about it for a while, it is now obvious to me why the
inline version doesn't fail - it is never instantiated.

So I went on and got to the attached file. This is the last one I'll
submit for this PR, I promise ;-)
It shows that the problem disappears, when I add a data member to the
base class and where the reference comes from:
ritzert@darkstar:~/tmp/gccbug > c++ i2.cpp
/tmp/cc0FgL6C.o(.gnu.linkonce.d._ZTCN5CORBA15Repository_implE4_NS_13IRObject_implE+0x2c):
undefined reference to `non-virtual thunk to
PortableServer::ServantBase::_non_existent()'
collect2: ld returned 1 exit status
ritzert@darkstar:~/tmp/gccbug > c++ -DWORKAROUND i2.cpp
ritzert@darkstar:~/tmp/gccbug >
(c++ is gcc version 3.1 20010901 (experimental))

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4122&database=gcc
namespace PortableServer
{
	class ServantBase
	{
	public:
		virtual void _non_existent() {};
#ifdef WORKAROUND
		int x;
#endif
	};

	class RefCountServantBase : public virtual ServantBase
	{
	};
}

namespace POA_CORBA
{
	class IRObject : virtual public PortableServer::ServantBase
	{
	};
}


namespace CORBA
{
	class IRObject_impl : public virtual PortableServer::RefCountServantBase,
		public virtual POA_CORBA::IRObject
{
};

}


namespace POA_CORBA
{
	class Container : virtual public POA_CORBA::IRObject
	{
	};
}


namespace CORBA
{
	class Container_impl : public virtual POA_CORBA::Container,
		public virtual IRObject_impl
	{
	};
}

namespace CORBA
{
	class Repository_impl : public virtual Container_impl
	{
	};
}

int
main()
{
	CORBA::Repository_impl x;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]