Fix handling of invalid assumed-shape/size arrays in legacy initializer lists.
authorFritz Reese <fritzoreese@gmail.com>
Mon, 16 Jul 2018 18:24:50 +0000 (18:24 +0000)
committerFritz Reese <foreese@gcc.gnu.org>
Mon, 16 Jul 2018 18:24:50 +0000 (18:24 +0000)
commite11449d15bda808658b71a0d6643192f0fc43947
tree6b4306e60445587b53dc304533c606f4e4dbd509
parent835e529de2dc75d9c051a178863ae68d8bf1d684
Fix handling of invalid assumed-shape/size arrays in legacy initializer lists.

2018-07-16  Fritz Reese  <fritzoreese@gmail.com>

    Fix handling of invalid assumed-shape/size arrays in legacy initializer
    lists.

    gcc/fortran/ChangeLog:

PR fortran/83184
* decl.c (match_old_style_init): Initialize locus of variable expr when
creating a data variable.
(match_clist_expr): Verify array is explicit shape/size before
attempting to allocate constant array constructor.

    gcc/testsuite/ChangeLog:

PR fortran/83184
* gfortran.dg/assumed_rank_14.f90: New testcase.
* gfortran.dg/assumed_rank_15.f90: New testcase.
* gfortran.dg/dec_structure_8.f90: Update error messages.
* gfortran.dg/dec_structure_23.f90: Update error messages.

From-SVN: r262744
gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/assumed_rank_14.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/assumed_rank_15.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/dec_structure_23.f90
gcc/testsuite/gfortran.dg/dec_structure_8.f90