]> git.ipfire.org Git - thirdparty/gcc.git/commit
fortran: ICE in gfc_conv_constant_to_tree PR93604
authorMark Eggleston <markeggleston@gcc.gnu.org>
Mon, 24 Feb 2020 14:33:35 +0000 (14:33 +0000)
committerMark Eggleston <markeggleston@gcc.gnu.org>
Mon, 24 Feb 2020 14:33:35 +0000 (14:33 +0000)
commitc77b6f95e014ad1f6654683ff56f9508fe7f268d
tree01af0228aa662dd697ed018bbc48333cedc984e1
parentfb6a8b230ad98ab3c42efc2968483ceb5ef62886
fortran: ICE in gfc_conv_constant_to_tree PR93604

Using a BOZ constant in a structure constructor in a data statement
resulted in an ICE. Output a "BOZ literal constant cannot appear in
a structure constructor" error message instead.

Original patch provided by Steven G. Kargl  <kargl@gcc.gnu.org>.

Test case added later.

gcc/fortran/ChangeLog

PR fortran/93604
* decl.c (gfc_match_data) : Check whether the data expression
is a derived type and is a constructor. If a BOZ constant
is encountered in the constructor output an error and return
MATCH_ERROR.

gcc/testsuite/ChangeLog

PR fortran/93604
* gfortran.dg/pr93604.f90 : New test.
gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr93604.f90 [new file with mode: 0644]