[4/4] RFC: abg-writer: add a missing check for emitted declarations
Commit Message
Before writing out extra referenced types, the function
write_translation_unit does not check if this was an already emitted
declaration-only type.
This may actually be intentional, given the following comment.
// We allow several *declarations* of the same class in the corpus,
// but only one definition.
* src/abg-writer.cc (write_translation_unit): Also check if an
an extra referenced type is declaration-only and already
emitted.
Signed-off-by: Giuliano Procida <gprocida@google.com>
---
src/abg-writer.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -2484,7 +2484,7 @@ write_translation_unit(write_context& ctxt,
// We handle types which have declarations *and* function
// types here.
type_base_sptr t(*i, noop_deleter());
- if (!ctxt.type_is_emitted(t))
+ if (!ctxt.type_is_emitted(t) && !ctxt.decl_only_type_is_emitted(t))
{
if (decl_base* d = get_type_declaration(*i))
{