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

--- 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:e1b3829ec8d5d3c6c08b6a3be0bcde23d3272573

commit r16-10050-ge1b3829ec8d5d3c6c08b6a3be0bcde23d3272573
Author: Mishmish Dev <[email protected]>
Date:   Fri Nov 27 11:19:23 2026 +0100

    c++: Mark empty structured binding as read [PR124977]

    This fixes the unused warning when an empty structured binding pack is
    expanded, by explicitly marking its underlying declaration as read.

    gcc/cp/ChangeLog:

            PR c++/124977
            * pt.cc (tsubst_pack_expansion): Mark the underlying structured
            binding declaration as read when expanding an empty pack.

    gcc/testsuite/ChangeLog:

            PR c++/124977
            * g++.dg/cpp26/decomp-pack-unused.C: New test.

    Signed-off-by: Mishmish Dev <[email protected]>
    (cherry picked from commit 4882367b86188ed846299140b7704e057a6d3f60)

Reply via email to