[Bug c++/85952] Bogus -Wunused-but-set-variable warning with array structured binding

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed May 30 07:37:00 GMT 2018


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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed May 30 07:36:49 2018
New Revision: 260919

URL: https://gcc.gnu.org/viewcvs?rev=260919&root=gcc&view=rev
Log:
        Backported from mainline
        2018-05-29  Jakub Jelinek  <jakub@redhat.com>

        PR c++/85952
        * init.c (build_aggr_init): For structured binding initialized from
        array call mark_rvalue_use on the initializer.

        * g++.dg/warn/Wunused-var-33.C: New test.

Added:
    branches/gcc-8-branch/gcc/testsuite/g++.dg/warn/Wunused-var-33.C
Modified:
    branches/gcc-8-branch/gcc/cp/ChangeLog
    branches/gcc-8-branch/gcc/cp/init.c
    branches/gcc-8-branch/gcc/testsuite/ChangeLog


More information about the Gcc-bugs mailing list