[Bug c++/66477] [constexpr] accepts-invalid with constexpr member call on non-constant reference

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 3 22:53:00 GMT 2020


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

--- Comment #4 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:87fbd5347b33883006dc77e779b9edc590fcd2f0

commit r10-6417-g87fbd5347b33883006dc77e779b9edc590fcd2f0
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Feb 3 16:03:45 2020 -0500

    c++: Fix constexpr vs. reference parameter.

    [expr.const] specifically rules out mentioning a reference even if its
    address is never used, because it implies indirection that is similarly
    non-constant for a pointer variable.

        PR c++/66477
        * constexpr.c (cxx_eval_constant_expression) [PARM_DECL]: Don't
        defer loading the value of a reference.


More information about the Gcc-bugs mailing list