mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 12:00:11 -05:00
Fortran: reject FORMAT tag of unknown type.
gcc/fortran/ChangeLog:
PR fortran/101084
* io.c (resolve_tag_format): Extend FORMAT check to unknown type.
gcc/testsuite/ChangeLog:
PR fortran/101084
* gfortran.dg/fmt_nonchar_3.f90: New test.
(cherry picked from commit f527b82334)
This commit is contained in:
@@ -1763,7 +1763,7 @@ resolve_tag_format (gfc_expr *e)
|
||||
if (e->ts.type != BT_CHARACTER)
|
||||
{
|
||||
if (e->ts.type == BT_DERIVED || e->ts.type == BT_CLASS
|
||||
|| e->ts.type == BT_VOID)
|
||||
|| e->ts.type == BT_VOID || e->ts.type == BT_UNKNOWN)
|
||||
{
|
||||
gfc_error ("Non-character non-Hollerith in FORMAT tag at %L",
|
||||
&e->where);
|
||||
|
||||
7
gcc/testsuite/gfortran.dg/fmt_nonchar_3.f90
Normal file
7
gcc/testsuite/gfortran.dg/fmt_nonchar_3.f90
Normal file
@@ -0,0 +1,7 @@
|
||||
! { dg-do compile }
|
||||
! PR fortran/101084
|
||||
|
||||
program p
|
||||
integer, parameter :: a(0) = 1
|
||||
print int(a) ! { dg-error "Non-character non-Hollerith in FORMAT tag" }
|
||||
end
|
||||
Reference in New Issue
Block a user