]> gcc.gnu.org Git - gcc.git/commit
c++: Adjust mangling of __alignof__ [PR88115]
authorPatrick Palka <ppalka@redhat.com>
Wed, 31 Mar 2021 02:57:11 +0000 (22:57 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 31 Mar 2021 02:57:11 +0000 (22:57 -0400)
commita3bf6ce7f2e17f2c977c13df23eb718e7b433dcd
tree6530f01c3cbe5630c0e79f11dbc363933ec0980d
parent0bbf0edbfc782f8e4e416d5fbd1b52a515adb585
c++: Adjust mangling of __alignof__ [PR88115]

r11-4926 made __alignof__ get mangled differently from alignof,
encoding __alignof__ as a vendor extended operator.  But this
mangling is problematic for the reasons mentioned in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88115#c6.

This patch changes our mangling of __alignof__ to instead use the
new "vendor extended expression" syntax that's proposed in
https://github.com/itanium-cxx-abi/cxx-abi/issues/112.  Clang does
the same thing already, so after this patch Clang and GCC agree
about the mangling of __alignof__(type) and __alignof__(expr).

gcc/cp/ChangeLog:

PR c++/88115
* mangle.c (write_expression): Adjust the mangling of
__alignof__.

include/ChangeLog:

PR c++/88115
* demangle.h (enum demangle_component_type): Add
DEMANGLE_COMPONENT_VENDOR_EXPR.

libiberty/ChangeLog:

PR c++/88115
* cp-demangle.c (d_dump, d_make_comp, d_expression_1)
(d_count_templates_scopes): Handle DEMANGLE_COMPONENT_VENDOR_EXPR.
(d_print_comp_inner): Likewise.
<case DEMANGLE_COMPONENT_EXTENDED_OPERATOR>: Revert r11-4926
change.
<case DEMANGLE_COMPONENT_UNARY>: Likewise.
* testsuite/demangle-expected: Adjust __alignof__ tests.

gcc/testsuite/ChangeLog:

PR c++/88115
* g++.dg/cpp0x/alignof7.C: Adjust expected mangling.
gcc/cp/mangle.c
gcc/testsuite/g++.dg/cpp0x/alignof7.C
include/demangle.h
libiberty/cp-demangle.c
libiberty/testsuite/demangle-expected
This page took 0.067412 seconds and 6 git commands to generate.