fix LightTransition

This commit is contained in:
David Rose 2001-06-07 17:51:07 +00:00
parent 2c9a5fdc72
commit 3ceb686cd7

View File

@ -205,7 +205,21 @@ define_extension_type(CPPExtensionType *type) {
}
if (type->is_template()) {
_templates.insert(Templates::value_type(name, type));
pair<Templates::iterator, bool> result =
_templates.insert(Templates::value_type(name, type));
if (!result.second) {
// The template was not inserted because we already had a
// template definition with the given name. If the previous
// definition was incomplete, replace it.
CPPDeclaration *old_templ = (*result.first).second;
CPPType *old_templ_type = old_templ->as_type();
if (old_templ_type == NULL || old_templ_type->is_incomplete()) {
// The previous template definition was incomplete, maybe a
// forward reference; replace it with the good one.
(*result.first).second = type;
}
}
}
}