]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: allow array mem-init with -fpermissive [PR116634]
authorJason Merrill <jason@redhat.com>
Mon, 4 Nov 2024 22:48:46 +0000 (17:48 -0500)
committerJason Merrill <jason@redhat.com>
Tue, 5 Nov 2024 16:02:36 +0000 (11:02 -0500)
commit3545aab00152ed3db1d7ce6ca4e1671dde276980
tree2fa9c16b10f74c7c8f6993cad9f37f6d9401cc70
parent6543a214485c0a722152e34de37424f9a0104bbb
c++: allow array mem-init with -fpermissive [PR116634]

We've accidentally accepted this forever (at least as far back as 4.7), but
it's always been ill-formed; this was PR59465.  And we didn't accept it for
scalar types.  But rather than switch to a hard error for this code, let's
give a permerror so affected code can continue to work with -fpermissive.

PR c++/116634

gcc/cp/ChangeLog:

* init.cc (can_init_array_with_p): Allow PR59465 case with
permerror.

gcc/testsuite/ChangeLog:

* g++.dg/diagnostic/aggr-init1.C: Expect warning with -fpermissive.
* g++.dg/init/array62.C: Adjust diagnostic.
* g++.dg/init/array63.C: Adjust diagnostic.
* g++.dg/init/array64.C: Adjust diagnostic.
gcc/cp/init.cc
gcc/testsuite/g++.dg/diagnostic/aggr-init1.C
gcc/testsuite/g++.dg/init/array62.C
gcc/testsuite/g++.dg/init/array63.C
gcc/testsuite/g++.dg/init/array64.C