From 97fb60db192436039c76b4ee24a0c22d85442c50 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 7 Jan 2026 10:58:38 +0100 Subject: [PATCH] Change *display_string_of for direct base class relationships. --- gcc/cp/reflect.cc | 2 +- gcc/testsuite/g++.dg/reflect/display_string_of1.C | 4 ++-- gcc/testsuite/g++.dg/reflect/u8display_string_of1.C | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/cp/reflect.cc b/gcc/cp/reflect.cc index daf20caf837..9a5c4581157 100644 --- a/gcc/cp/reflect.cc +++ b/gcc/cp/reflect.cc @@ -3631,7 +3631,7 @@ eval_display_string_of (location_t loc, const constexpr_ctx *ctx, tree r, else if (kind == REFLECT_BASE) { tree d = direct_base_parent (r); - pp_printf (&pp, "(%T, %T)", d, BINFO_TYPE (r)); + pp_printf (&pp, "%T: %T", d, BINFO_TYPE (r)); } else if (kind == REFLECT_DATA_MEMBER_SPEC) pp_printf (&pp, "(%T, %E, %E, %E, %s)", TREE_VEC_ELT (r, 0), diff --git a/gcc/testsuite/g++.dg/reflect/display_string_of1.C b/gcc/testsuite/g++.dg/reflect/display_string_of1.C index d3707608b91..b88828fec39 100644 --- a/gcc/testsuite/g++.dg/reflect/display_string_of1.C +++ b/gcc/testsuite/g++.dg/reflect/display_string_of1.C @@ -112,7 +112,7 @@ foo (int a, const long b, T c, int d[4], T &e) static_assert (display_string_of (^^Concept) == "template > concept Concept"); static_assert (display_string_of (^^NSAlias) == "NSAlias"); static_assert (display_string_of (^^NS) == "NS"); - static_assert (display_string_of (bases_of (^^S, ctx)[0]) == "(S, B)"); + static_assert (display_string_of (bases_of (^^S, ctx)[0]) == "S: B"); static_assert (display_string_of (data_member_spec (^^int, { .name = "member", .alignment = 128, .no_unique_address = true })) == "(int, member, 128, , true)"); static_assert (display_string_of (data_member_spec (^^const int, { .name = "member", .bit_width = 6 })) == "(const int, member, , 6, false)"); static_assert (display_string_of (data_member_spec (^^int, { .bit_width = 0 })) == "(int, , , 0, false)"); @@ -216,7 +216,7 @@ namespace NS5 { static_assert (display_string_of (^^TFn) == "template > void NS5::TFn()"); static_assert (display_string_of (^^TVar) == "template > int NS5::TVar< >"); static_assert (display_string_of (^^Concept) == "template > concept NS5::Concept"); - static_assert (display_string_of (bases_of (^^S, ctx)[0]) == "(NS5::S, NS5::B)"); + static_assert (display_string_of (bases_of (^^S, ctx)[0]) == "NS5::S: NS5::B"); static_assert (display_string_of (annotations_of (^^bar)[0]) == "[[=1]]"); static_assert (display_string_of (annotations_of (^^bar)[1]) == "[[=NS5::AN{1, 42, ' '}]]"); static_assert (display_string_of (^^int (&) (int, long, S &)) == "int (&)(int, long int, NS5::S&)"); diff --git a/gcc/testsuite/g++.dg/reflect/u8display_string_of1.C b/gcc/testsuite/g++.dg/reflect/u8display_string_of1.C index 762a3c4be19..693162e3bb1 100644 --- a/gcc/testsuite/g++.dg/reflect/u8display_string_of1.C +++ b/gcc/testsuite/g++.dg/reflect/u8display_string_of1.C @@ -112,7 +112,7 @@ foo (int a, const long b, T c, int d[4], T &e) static_assert (u8display_string_of (^^Concept) == u8"template > concept Concept"); static_assert (u8display_string_of (^^NSAlias) == u8"NSAlias"); static_assert (u8display_string_of (^^NS) == u8"NS"); - static_assert (u8display_string_of (bases_of (^^S, ctx)[0]) == u8"(S, B)"); + static_assert (u8display_string_of (bases_of (^^S, ctx)[0]) == u8"S: B"); static_assert (u8display_string_of (data_member_spec (^^int, { .name = "member", .alignment = 128, .no_unique_address = true })) == u8"(int, member, 128, , true)"); static_assert (u8display_string_of (data_member_spec (^^const int, { .name = "member", .bit_width = 6 })) == u8"(const int, member, , 6, false)"); static_assert (u8display_string_of (data_member_spec (^^int, { .bit_width = 0 })) == u8"(int, , , 0, false)"); @@ -216,7 +216,7 @@ namespace NS5 { static_assert (u8display_string_of (^^TFn) == u8"template > void NS5::TFn()"); static_assert (u8display_string_of (^^TVar) == u8"template > int NS5::TVar< >"); static_assert (u8display_string_of (^^Concept) == u8"template > concept NS5::Concept"); - static_assert (u8display_string_of (bases_of (^^S, ctx)[0]) == u8"(NS5::S, NS5::B)"); + static_assert (u8display_string_of (bases_of (^^S, ctx)[0]) == u8"NS5::S: NS5::B"); static_assert (u8display_string_of (annotations_of (^^bar)[0]) == u8"[[=1]]"); static_assert (u8display_string_of (annotations_of (^^bar)[1]) == u8"[[=NS5::AN{1, 42, ' '}]]"); static_assert (u8display_string_of (^^int (&) (int, long, S &)) == u8"int (&)(int, long int, NS5::S&)");