From e5bed8512fb34f12ded5b0aac73d837e02d7f404 Mon Sep 17 00:00:00 2001 From: Matthias Maennich Date: Fri, 3 Dec 2021 11:46:23 +0000 Subject: [PATCH] XML writer: resolve declaration-only enum definitions Let the writer look through declaration-only enums for definitions. This matches what get_preferred_type, write_class_decl and write_union_decl do. No current test cases are affected. * src/abg-writer.cc (write_enum_type_decl): Look through declaration-only types the same as for structs and unions. Reviewed-by: Giuliano Procida Signed-off-by: Matthias Maennich --- src/abg-writer.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/abg-writer.cc b/src/abg-writer.cc index 7ed8327a..24a1fd56 100644 --- a/src/abg-writer.cc +++ b/src/abg-writer.cc @@ -3008,14 +3008,16 @@ write_array_type_def(const array_type_def_sptr& decl, /// /// @return true upon succesful completion, false otherwise. static bool -write_enum_type_decl(const enum_type_decl_sptr& decl, - const string& id, - write_context& ctxt, - unsigned indent) +write_enum_type_decl(const enum_type_decl_sptr& d, + const string& id, + write_context& ctxt, + unsigned indent) { - if (!decl) + if (!d) return false; + enum_type_decl_sptr decl = is_enum_type(look_through_decl_only_enum(d)); + annotate(decl->get_canonical_type(), ctxt, indent); ostream& o = ctxt.get_ostream(); -- 2.43.5