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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Jakub Jelinek
<[email protected]>:

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

commit r16-9877-gca57ad11199ea822a5e72131b3f154de93853fe6
Author: Jakub Jelinek <[email protected]>
Date:   Wed Oct 21 09:04:21 2026 +0200

    c++: Call check_trait_type for CPTK_STRUCTURED_BINDING_SIZE [PR127766]

    The following testcase is rejected because we don't even try to complete
    the type, so if it wasn't instantiated with those arguments before, we
    reject it.
    Fixed up calling check_trait_type, with kind 4, for non-class I think
    cp_decomp_size already does the right thing, for arrays we actually just
    care about number of elements.
    On the pt.cc side, fixed by removing the special casing of this exact
    trait and instead passing complain to all finish_trait_expr calls in
    TRAIT_EXPR case.

    2026-10-21  Jakub Jelinek  <[email protected]>

            PR c++/127766
            * semantics.cc (finish_structured_binding_size): Call
            check_trait_type with kind 4.

            * g++.dg/ext/builtin-structured-binding-size2.C: Expect different
            diagnostics.
            * g++.dg/ext/builtin-structured-binding-size7.C: New test.

    Reviewed-by: Jason Merrill <[email protected]>
    (cherry picked from commit 1498f0547eb1692c39c63ad3e8e22859dc526e3e)

Reply via email to