c++: Disable -Winit-list-lifetime in unevaluated operand [PR97632]
authorMarek Polacek <polacek@redhat.com>
Thu, 29 Oct 2020 19:08:31 +0000 (15:08 -0400)
committerMarek Polacek <polacek@redhat.com>
Tue, 3 Nov 2020 15:09:00 +0000 (10:09 -0500)
commitf620e64a6f13371b95be5b17abba0acf15bf7cae
treea0d2b08c0195e9b82eb50a635fd6efe333c39144
parent6ff95a6eefbe02288fbc9f3de456e5e820d2bd80
c++: Disable -Winit-list-lifetime in unevaluated operand [PR97632]

Jon suggested turning this warning off when we're not actually
evaluating the operand.  This patch does that.

gcc/cp/ChangeLog:

PR c++/97632
* init.c (build_new_1): Disable -Winit-list-lifetime for an unevaluated
operand.

gcc/testsuite/ChangeLog:

PR c++/97632
* g++.dg/warn/Winit-list4.C: New test.
gcc/cp/init.c
gcc/testsuite/g++.dg/warn/Winit-list4.C [new file with mode: 0644]