[odb-users] odb compiler assert when db value pragma placed on subclass

Stroud, Sean T ststrou at sandia.gov
Fri Oct 5 16:31:21 EDT 2012


I get an assert from odb on the following program:

File foo.h:
class Bar

#pragma db value
class Foo : public Bar
    int m_seconds;

Here is what I get when I run odb:

% odb -d mysql foo.h
cc1plus: common.cxx:68: virtual void object_members_base::traverse(semantics::class_&): Assertion `context::top_object != 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 /home/ststrou/ODB2.1/odb-2.1.0-x86_64-linux-gnu/x86_64-linux-gnu/bin/../lib64/gcc/../../include/odb/container-traits.hxx:196:0,
                 from <standard-odb-epilogue>:9:
/home/ststrou/ODB2.1/odb-2.1.0-x86_64-linux-gnu/x86_64-linux-gnu/bin/../lib64/gcc/../../include/odb/std-vector-traits.hxx:65: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.

Note the following:
-       The assert does not happen if I delete the "#pragma db value" line
-       The assert does not happen if I eliminate the Foo -> Bar inheritance

I assume this is a bug.  However, I was wondering what odb will do once this bug is fixed.  Will the odb compiler support this kind of situation (i.e. db value pragma on a subclass)?  Or will it reject my program with an error message?  Does it matter if  the base class has data members or not?  Does it matter if it inherits from multiple classes?



More information about the odb-users mailing list