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

--- Comment #4 from GCC 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:2d7a0d38e2f8e281ab2269cfe6c048410fa3c886

commit r16-357-g2d7a0d38e2f8e281ab2269cfe6c048410fa3c886
Author: Jason Merrill <ja...@redhat.com>
Date:   Fri May 2 08:35:38 2025 -0400

    c++: CTAD and constexpr ctor [PR115207]

    Here we failed to constant-evaluate the A<int> constructor because
DECL_SIZE
    wasn't set on 'a' yet, so compare_address thinks we can't be sure it isn't
    at the same address as 'i'.

    Normally DECL_SIZE is set by build_decl calling layout_decl, but that
    doesn't happen here because we don't have a type yet.  So we need to
    layout_decl again after deduction.

            PR c++/115207

    gcc/cp/ChangeLog:

            * decl.cc (cp_finish_decl): Call layout_decl after CTAD.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1z/class-deduction118.C: New test.

Reply via email to