[Bug c++/70097] Cannot assign ref-qualified non-static member function

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70097

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <[email protected]>:

https://gcc.gnu.org/g:8f188b67517ce41561295506e3ba01ec1524854a

commit r17-3396-g8f188b67517ce41561295506e3ba01ec1524854a
Author: Eczbek <[email protected]>
Date:   Sun May 24 18:58:09 2026 -0400

    c++: Fix propagating reference qualifier from function type to member
function pointer type [PR70097]

    When forming a member function pointer type to a ref-qualified function
    type, the reference qualifier is incorrectly dropped.

            PR c++/70097

    gcc/cp/ChangeLog:

            * decl.cc (grokdeclarator): If rqual is REF_QUAL_NONE, set it to
            result of type_memfn_rqual before passing to build_memfn_type.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/ref-qual22.C: New test.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.