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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>:

https://gcc.gnu.org/g:9b239d05ffd5a17ede44abd55bc6622c6e279868

commit r12-4228-g9b239d05ffd5a17ede44abd55bc6622c6e279868
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Wed Sep 29 21:19:49 2021 +0100

    c++: Do not warn about lifetime of std::initializer_list<T>& [PR102482]

    An initializer-list constructor taking a non-const lvalue cannot be
    called with a temporary, so the array's lifetime probably doesn't end
    with the full expression. -Winit-list-lifetime should not warn for that
    case.

            PR c++/102482

    gcc/cp/ChangeLog:

            * init.c (maybe_warn_list_ctor): Do not warn for a reference to
            a non-const std::initializer_list.

    gcc/testsuite/ChangeLog:

            * g++.dg/warn/Winit-list5.C: New test.

Reply via email to