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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Patrick Palka
<ppa...@gcc.gnu.org>:

https://gcc.gnu.org/g:e62029a785b3a5e98123da6ef01ca94c003c306d

commit r11-8521-ge62029a785b3a5e98123da6ef01ca94c003c306d
Author: Patrick Palka <ppa...@redhat.com>
Date:   Thu Jun 3 09:37:11 2021 -0400

    c++: using-enum and access specifiers [PR100862]

    When copying the enumerators imported by a class-scope using-enum
    declaration, we need to override current_access_specifier so that
    finish_member_declaration gives the copies the same access as the
    using-enum decl.  (A class-scope using-enum is processed late, so
    current_access_specifier at this point is otherwise set to the last
    access specifier within the class.)  To that end, this patch makes
    handle_using_decl call set_current_access_from_decl accordingly.

    For consistency, this patch makes build_enumerator use
    set_current_access_from_decl too.

            PR c++/100862

    gcc/cp/ChangeLog:

            * pt.c (set_current_access_from_decl): Move to ...
            * class.c (set_current_access_from_decl): ... here.
            (handle_using_decl): Use it to propagate the access of the
            using-enum decl to the copy of the imported enumerator.
            * cp-tree.h (set_current_access_from_decl): Declare.
            * decl.c (build_enumerator): Simplify using make_temp_override
            and set_current_access_from_decl.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/using-enum-9.C: New test.

    (cherry picked from commit 69f517ac20566a645ff41a9bfca535822205a538)
  • [Bug c++/100862] using enum mem... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to