GNOME Bugzilla – Bug 108047
multiple inheritance problem in IDL compiler
Last modified: 2004-12-22 21:47:04 UTC
I am having some difficulty with ORBit cpp (orbitcpp-1.3.4, ORBit2-2.6.0) and multiple inheritance of interfaces. I have the following file mi.idl: module foo { interface Symbol { string name(); }; interface Hash { long hash(); }; interface Variable : Symbol, Hash { }; }; Compiling the idl and then the stubs file causes problems with multiple definition of Hash::hash() where the second definition should probably be Variable::hash(). [owe043@phi bug]$ orbit-idl-2 mi.idl ; orbit-idl-2 -l cpp mi.idl ; g++ -c mi-cpp.cc `pkg-config ORBit-2.0-cpp --cflags` orbit-idl-2 2.6.0 compiling mode, show preprocessor errors, passes: stubs skels common headers skel_impl imodule orbit-idl-2 2.6.0 compiling mode, show preprocessor errors, passes: stubs skels common headers skel_impl imodule ** (process:4194): WARNING **: orbit_idl_backend_func In file included from mi-cpp.cc:7: mi-cpp-stubs.cc:60: redefinition of `Long _orbitcpp::stub::foo::Hash::hash()' mi-cpp-stubs.cc:36: `Long _orbitcpp::stub::foo::Hash::hash()' previously defined here mi-cpp-stubs.cc:60: no `Long _orbitcpp::stub::foo::Hash::hash()' member function declared in class `_orbitcpp::stub::foo::Hash' mi-cpp-stubs.cc:63: confused by earlier errors, bailing out Below is the contents of mi-cpp-stubs.cpp. // ----------------------------------------------------- // generated by orbitcpp, do not edit // ----------------------------------------------------- #include "mi-cpp-stubs.h" // Stub code ------------------------------------------- char * _orbitcpp::stub::foo::Symbol::name () { ::_orbitcpp::CEnvironment _ev; char *_retval = foo_Symbol_name (_orbitcpp_cobj (), _ev._orbitcpp_cobj ()); _ev.propagate_sysex (); if (_ev->_major == ::CORBA_USER_EXCEPTION) { throw CORBA::UnknownUserException(); } return _retval; } _orbitcpp::stub::foo::Symbol::Symbol (foo_Symbol cobject, bool take_copy /*= false */): CORBA::Object(cobject, take_copy) {} ::_orbitcpp::stub::foo::Symbol * _orbitcpp::stub::foo::Symbol::_orbitcpp_wrap (foo_Symbol cobject, bool take_copy /* = false */) { return new ::_orbitcpp::stub::foo::Symbol (cobject, take_copy); } CORBA::Long _orbitcpp::stub::foo::Hash::hash () { ::_orbitcpp::CEnvironment _ev; CORBA::Long _retval = foo_Hash_hash (_orbitcpp_cobj (), _ev._orbitcpp_cobj ()); _ev.propagate_sysex (); if (_ev->_major == ::CORBA_USER_EXCEPTION) { throw CORBA::UnknownUserException(); } return _retval; } _orbitcpp::stub::foo::Hash::Hash (foo_Hash cobject, bool take_copy /*= false */): CORBA::Object(cobject, take_copy) {} ::_orbitcpp::stub::foo::Hash * _orbitcpp::stub::foo::Hash::_orbitcpp_wrap (foo_Hash cobject, bool take_copy /* = false */) { return new ::_orbitcpp::stub::foo::Hash (cobject, take_copy); } CORBA::Long _orbitcpp::stub::foo::Hash::hash () { ::_orbitcpp::CEnvironment _ev; CORBA::Long _retval = foo_Hash_hash (_orbitcpp_cobj (), _ev._orbitcpp_cobj ()); _ev.propagate_sysex (); if (_ev->_major == ::CORBA_USER_EXCEPTION) { throw CORBA::UnknownUserException(); } return _retval; } _orbitcpp::stub::foo::Variable::Variable (foo_Variable cobject, bool take_copy /*= false */): ::_orbitcpp::stub::foo::Symbol(cobject, take_copy) {} ::_orbitcpp::stub::foo::Variable * _orbitcpp::stub::foo::Variable::_orbitcpp_wrap (foo_Variable cobject, bool take_copy /* = false */) { return new ::_orbitcpp::stub::foo::Variable (cobject, take_copy); }
Fixed in CVS HEAD