[PR c++/84729] reject parenthesized array init
authorAlexandre Oliva <aoliva@redhat.com>
Fri, 23 Mar 2018 01:19:01 +0000 (01:19 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Fri, 23 Mar 2018 01:19:01 +0000 (01:19 +0000)
commit3ec16e36107214035fe9d1177e0acc6ebe037112
tree5507925d2db5beeb704eaedf8a5f95a25504d3b0
parent91f9108f1bd90c307daadfb4876258ec57cb746b
[PR c++/84729] reject parenthesized array init

A parenthesized initializer was only accepted when new()ing an array in
permissive mode.  We were not careful, however, to convert the
TREE_LIST initializer to the array element type in this extension.

Instead of fixing it, converting the initializer to the base type
after turning the TREE_LIST initializer to a compound_expr, we disable
this deprecated extension.

for  gcc/cp/ChangeLog

PR c++/84729
* init.c (build_vec_init): Error at parenthesized array init.

for  gcc/testsuite/ChangeLog

PR c++/84729
* g++.dg/pr84729.C: New.
        * g++.old-deja/g++.ext/arrnew2.C: Require error.
* g++.old-deja/g++.robertl/eb58.C: Likewise.
* g++.old-deja/g++.robertl/eb63.C: Likewise.

From-SVN: r258791
gcc/cp/ChangeLog
gcc/cp/init.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr84729.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ext/arrnew2.C
gcc/testsuite/g++.old-deja/g++.robertl/eb58.C
gcc/testsuite/g++.old-deja/g++.robertl/eb63.C