diff --git a/src/gsi/gsi/gsiClassBase.cc b/src/gsi/gsi/gsiClassBase.cc index 04e1b86a1..7ee9acd8f 100644 --- a/src/gsi/gsi/gsiClassBase.cc +++ b/src/gsi/gsi/gsiClassBase.cc @@ -679,7 +679,6 @@ ClassBase::classes_in_definition_order (const char *mod_name) if ((*c)->declaration () && (*c)->declaration () != *c && taken.find ((*c)->declaration ()) == taken.end ()) { // can't produce this class yet - it's a reference to another class which is not produced yet. - tl_assert ((*c)->declaration () != 0); more_classes.push_back (*c); continue; } diff --git a/src/gsi/gsi/gsiExpression.cc b/src/gsi/gsi/gsiExpression.cc index 1c1d4ba3f..911d38fcc 100644 --- a/src/gsi/gsi/gsiExpression.cc +++ b/src/gsi/gsi/gsiExpression.cc @@ -1077,8 +1077,12 @@ initialize_expressions () std::list classes = gsi::ClassBase::classes_in_definition_order (); for (std::list::const_iterator c = classes.begin (); c != classes.end (); ++c) { - // Skip external classes - if ((*c)->is_external ()) { + // we might encounter a child class which is a reference to a top-level class (e.g. + // duplication of enums into child classes). In this case we should create a reference inside the + // target class. + if ((*c)->declaration () != *c) { + tl_assert ((*c)->parent () != 0); // top-level classes should be merged + // TODO: implement (see rba.cc:1544 for example) continue; }