Am 24.06.26 um 16:23 schrieb Marek Polacek:
On Wed, Jun 24, 2026 at 11:48:02AM +0200, Georg-Johann Lay wrote:
In mangle.cc there is:

/* Return an identifier for a construction vtable group.  TYPE is
    the most derived class in the hierarchy; BINFO is the base
    subobject for which this construction vtable group will be used.

    This mangling isn't part of the ABI specification; in the ABI
    specification, the vtable group is dumped in the same COMDAT as the
    main vtable, and is referenced only from that vtable, so it doesn't
    need an external name.  For binary formats without COMDAT sections,
    though, we need external names for the vtable groups.

    We use the production

     <special-name> ::= CT <type> <offset number> _ <base type>  */

tree
mangle_ctor_vtbl_for_type (const tree type, const tree binfo)
{
   tree result;

   start_mangling (type);

   write_string ("_Z");
   write_string ("TC");


So it seems there is an obvious typo in the comment which says "CT"
but the actual mangling is "TC".

If ok I would apply the following patch to trunk:


diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc
index 8c67b67b197..d368359dccd 100644
--- a/gcc/cp/mangle.cc
+++ b/gcc/cp/mangle.cc
@@ -5131,7 +5131,7 @@ mangle_decomp (const tree decl, vec<tree> &decls)

     We use the production

-    <special-name> ::= CT <type> <offset number> _ <base type>  */
+    <special-name> ::= TC <type> <offset number> _ <base type>  */

Looks good, but it will need a ChangeLog entry.

Marek

Of course.  Without it, git won't even accept a push.  The log entry is:

c++: Fix production comment for mangle_ctor_vtbl_for_type.

mangle.cc::mangle_ctor_vtbl_for_type has
   write_string ("_Z");
   write_string ("TC");
and hence the function comment should read
   We use the production
   <special-name> ::= TC <type> ...
instead of the current
   <special-name> ::= CT <type> ...

gcc/cp/
        * mangle.cc (mangle_ctor_vtbl_for_type): Fix production in comment.


Johann


Reply via email to