diff options
author | Patrick Palka <ppalka@redhat.com> | 2023-06-03 09:03:27 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2023-06-03 09:03:27 -0400 |
commit | 999e617d3121b82921c8031ee695fd036f553f04 (patch) | |
tree | 1f8957c6a5818113623ea80228eeb55cb1480b82 /gcc/cp | |
parent | 38e88d41f50d844f1404172657ef7e8372014ef6 (diff) | |
download | gcc-999e617d3121b82921c8031ee695fd036f553f04.zip gcc-999e617d3121b82921c8031ee695fd036f553f04.tar.gz gcc-999e617d3121b82921c8031ee695fd036f553f04.tar.bz2 |
c++: mangle noexcept-expr [PR70790]
This implements noexcept(expr) mangling and demangling as per the
Itanium ABI.
PR c++/70790
gcc/cp/ChangeLog:
* mangle.cc (write_expression): Handle NOEXCEPT_EXPR.
libiberty/ChangeLog:
* cp-demangle.c (cplus_demangle_operators): Add the noexcept
operator.
(d_print_comp_inner) <case DEMANGLE_COMPONENT_UNARY>: Always
print parens around the operand of noexcept too.
* testsuite/demangle-expected: Test noexcept operator
demangling.
gcc/testsuite/ChangeLog:
* g++.dg/abi/mangle78.C: New test.
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/mangle.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/mangle.cc b/gcc/cp/mangle.cc index 826c5e7..7dab4e6 100644 --- a/gcc/cp/mangle.cc +++ b/gcc/cp/mangle.cc @@ -3402,6 +3402,11 @@ write_expression (tree expr) else write_string ("tr"); } + else if (code == NOEXCEPT_EXPR) + { + write_string ("nx"); + write_expression (TREE_OPERAND (expr, 0)); + } else if (code == CONSTRUCTOR) { bool braced_init = BRACE_ENCLOSED_INITIALIZER_P (expr); |