diff options
author | Jason Merrill <jason@redhat.com> | 2020-12-21 17:36:25 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-12-21 21:13:41 -0500 |
commit | 58fb912c15175f4444144b8a4ab52a4880b84994 (patch) | |
tree | 30eb36cd8436ac5f9d9dc3d0b4f4e56018450252 /libiberty/testsuite | |
parent | 93ac0c05ffc84acba8e73ed5238fc325044378e0 (diff) |
c++: Fix demangling of <unresolved-name>
The ABI for unresolved scoped names on the RHS of . and -> used to be
sr <type> <unqualified-id>
That changed years ago to something more complex, but G++ was never updated.
This change was particularly incompatible for simple qualified-ids like
A::x, which were previously mangled as sr1A1x, and now sr1AE1x.
This obviously makes life hard for demanglers, which can't know whether to
consume that E or not. To work around this, we now try demangling with the
newer ABI, and if that fails and we saw an "sr", try again with the older
ABI.
libiberty/ChangeLog:
PR c++/67343
* cp-demangle.h (struct d_info): Add unresolved_name_state.
* cp-demangle.c (d_prefix): Add subst parm.
(d_nested_name): Pass it.
(d_unresolved_name): Split out from...
(d_expression_1): ...here.
(d_demangle_callback): Maybe retry with old sr mangling.
* testsuite/demangle-expected: Add test.
Diffstat (limited to 'libiberty/testsuite')
-rw-r--r-- | libiberty/testsuite/demangle-expected | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index 6789d0d1d9d..e6b5b64b9a9 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -1485,3 +1485,6 @@ decltype (({parm#1}.(operator A*))()) j<A>(A) _Z1fI1AEDtdtfp_srT_1xES1_ decltype ({parm#1}.A::x) f<A>(A) + +_Z2f6IP1AEDtptfp_gssr1A1BE1xET_ +decltype ({parm#1}->(::A::B::x)) f6<A*>(A*) |