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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Richard Biener
<rgue...@gcc.gnu.org>:

https://gcc.gnu.org/g:892024d4af83b258801ff7484bf28f0cf1a1a999

commit r10-9651-g892024d4af83b258801ff7484bf28f0cf1a1a999
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Thu Apr 1 09:59:47 2021 +0200

    c++, abi: Fix abi_tag attribute handling [PR98481]

    In GCC10 cp_walk_subtrees has been changed to walk template arguments.
    As the following testcase, that changed the mangling of some functions.
    I believe the previous behavior that find_abi_tags_r doesn't recurse into
    template args has been the correct one, but setting *walk_subtrees = 0
    for the types and handling the types subtree walking manually in
    find_abi_tags_r looks too hard, there are a lot of subtrees and details
what
    should and shouldn't be walked, both in tree.c (walk_type_fields there,
    which is static) and in cp_walk_subtrees itself.

    The following patch abuses the fact that *walk_subtrees is an int to
    tell cp_walk_subtrees it shouldn't walk the template args.

    But we don't want to introduce an ABI change in the middle of the GCC 10
    cycle, so the GCC 10 version of this patch introduces ABI v15 for the fix,
    which will be available but not default in GCC 10.3.

    Co-authored-by: Jason Merrill <ja...@redhat.com>

    gcc/cp/ChangeLog:

            PR c++/98481
            * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1
            for types.
            (mark_abi_tags_r): Likewise.
            * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through
            typedefs.

    gcc/testsuite/ChangeLog:

            PR c++/98481
            * g++.dg/abi/abi-tag24.C: New test.
            * g++.dg/abi/abi-tag24a.C: New test.
            * g++.dg/abi/macro0.C: Adjust expected value.

    gcc/ChangeLog:

            PR c++/98481
            * common.opt (fabi-version): Default to 14.

    gcc/c-family/ChangeLog:

            PR c++/98481
            * c-opts.c (c_common_post_options): Bump latest_abi_version.

Reply via email to