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

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

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

commit r14-2149-gabdf0b6cdff5783b97f35ad61ae31433f0569dfd
Author: Jason Merrill <ja...@redhat.com>
Date:   Tue Jun 27 05:15:01 2023 -0400

    c++: inherited constructor attributes

    Inherited constructors are like constructor clones; they don't exist from
    the language perspective, so they should copy the attributes in the same
    way.  But it doesn't make sense to copy alias or ifunc attributes in either
    case.  Unlike handle_copy_attribute, we do want to copy inlining
attributes.

    The discussion of PR110334 pointed out that we weren't copying the
    always_inline attribute, leading to poor inlining choices.

            PR c++/110334

    gcc/cp/ChangeLog:

            * cp-tree.h (clone_attrs): Declare.
            * method.cc (implicitly_declare_fn): Use it for inherited
            constructor.
            * optimize.cc (clone_attrs): New.
            (maybe_clone_body): Use it.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1z/nodiscard-inh1.C: New test.

Reply via email to