[odb-users] Attempting to create an index on an inverse pointer crashes compiler instead of producing an error

Murray Wilson murray.wilson at gmail.com
Fri Aug 15 19:48:49 EDT 2014


Attempting to precompile this erroneous header with odb:

PRAGMA_DB(object table("device") polymorphic)
class Device : public LockableDatabaseMessage
{
PRAGMA_DB(value_not_null inverse(deviceList))
lazy_weak_ptr<Room> room;

PRAGMA_DB(index("fk_room") members(room))
};

will crash the compiler with this error:

cc1plus: ../odb/relational/model.hxx:432: virtual void
relational::model::object_indexes::traverse(cutl::compiler::traverser_impl<semantics::class_,
semantics::node>::type&): Assertion `c != 0' failed.
*** WARNING *** there are active plugins, do not report this as a bug
unless you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_START_UNIT                | odb
PLUGIN_PRAGMAS                   | odb
PLUGIN_OVERRIDE_GATE             | odb
In file included from <standard-odb-epilogue>:8:0:
/usr/local/include/odb/tr1/pointer-traits.hxx: In destructor ‘virtual
boost::exception_detail::clone_base::~clone_base()’:
/usr/local/include/odb/tr1/pointer-traits.hxx:116:1: internal compiler
error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

instead of pointing out that you can not create an index where there is no
column in the table to create it on.


More information about the odb-users mailing list