[Bug c++/97474] [8/9/10/11 Regression] produces wrong code with references to another field

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 26 22:11:50 GMT 2021


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

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

https://gcc.gnu.org/g:96253f069ead0736536de803b06a8053a85039a6

commit r11-6919-g96253f069ead0736536de803b06a8053a85039a6
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Jan 26 16:04:24 2021 -0500

    c++: Invisible refs are not restrict [PR97474]

    In this testcase, we refer to the a parameter through a reference in its
own
    member, which we asserted couldn't happen by marking the parameter as
    'restrict'.  This assumption could also be broken if the address escapes
    from the constructor.

    gcc/cp/ChangeLog:

            PR c++/97474
            * call.c (type_passed_as): Don't mark invisiref restrict.

    gcc/testsuite/ChangeLog:

            PR c++/97474
            * g++.dg/torture/pr97474.C: New test.


More information about the Gcc-bugs mailing list