https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67343

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:58fb912c15175f4444144b8a4ab52a4880b84994

commit r11-6300-g58fb912c15175f4444144b8a4ab52a4880b84994
Author: Jason Merrill <ja...@redhat.com>
Date:   Mon Dec 21 17:36:25 2020 -0500

    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.

Reply via email to