diff options
author | Jakub Jelinek <jakub@redhat.com> | 2024-01-13 10:23:53 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2024-01-13 10:23:53 +0100 |
commit | 65388b28656d65595bdaf191df85af81c35ca638 (patch) | |
tree | 60a1fbdd28b8418a75b4e508a4a3a429ba7149d1 /gcc/cp | |
parent | 34a827039fabcf24ce78da25984a1cc8be7ca2c3 (diff) | |
download | gcc-65388b28656d65595bdaf191df85af81c35ca638.zip gcc-65388b28656d65595bdaf191df85af81c35ca638.tar.gz gcc-65388b28656d65595bdaf191df85af81c35ca638.tar.bz2 |
c++, demangle: Implement https://github.com/itanium-cxx-abi/cxx-abi/issues/148 non-proposal
The following patch attempts to implement what apparently clang++
implemented for explicit object member function mangling, but nobody
actually proposed in patch form in
https://github.com/itanium-cxx-abi/cxx-abi/issues/148
2024-01-13 Jakub Jelinek <jakub@redhat.com>
gcc/cp/
* mangle.cc (write_nested_name): Mangle explicit object
member functions with H as per
https://github.com/itanium-cxx-abi/cxx-abi/issues/148 non-proposal.
gcc/testsuite/
* g++.dg/abi/mangle79.C: New test.
include/
* demangle.h (enum demangle_component_type): Add
DEMANGLE_COMPONENT_XOBJ_MEMBER_FUNCTION.
libiberty/
* cp-demangle.c (FNQUAL_COMPONENT_CASE): Add case for
DEMANGLE_COMPONENT_XOBJ_MEMBER_FUNCTION.
(d_dump): Handle DEMANGLE_COMPONENT_XOBJ_MEMBER_FUNCTION.
(d_nested_name): Parse H after N in nested name.
(d_count_templates_scopes): Handle
DEMANGLE_COMPONENT_XOBJ_MEMBER_FUNCTION.
(d_print_mod): Likewise.
(d_print_function_type): Likewise.
* testsuite/demangle-expected: Add tests for explicit object
member functions.
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/mangle.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc index 7d8f443..a04bc58 100644 --- a/gcc/cp/mangle.cc +++ b/gcc/cp/mangle.cc @@ -1247,6 +1247,9 @@ write_nested_name (const tree decl) write_char ('R'); } } + else if (DECL_DECLARES_FUNCTION_P (decl) + && DECL_XOBJ_MEMBER_FUNCTION_P (decl)) + write_char ('H'); /* Is this a template instance? */ if (tree info = maybe_template_info (decl)) |