Fortran: reject BOZ type argument to SIZEOF().
gcc/fortran/ChangeLog: PR fortran/103412 * check.c (gfc_check_sizeof): Reject BOZ type argument. gcc/testsuite/ChangeLog: PR fortran/103412 * gfortran.dg/illegal_boz_arg_2.f90: New test.
This commit is contained in:
parent
31048012db
commit
fd74a2ee40
2 changed files with 9 additions and 0 deletions
|
@ -5135,6 +5135,9 @@ gfc_check_sizeof (gfc_expr *arg)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (illegal_boz_arg (arg))
|
||||
return false;
|
||||
|
||||
/* TYPE(*) is acceptable if and only if it uses an array descriptor. */
|
||||
if (arg->ts.type == BT_ASSUMED
|
||||
&& (arg->symtree->n.sym->as == NULL
|
||||
|
|
6
gcc/testsuite/gfortran.dg/illegal_boz_arg_2.f90
Normal file
6
gcc/testsuite/gfortran.dg/illegal_boz_arg_2.f90
Normal file
|
@ -0,0 +1,6 @@
|
|||
! { dg-do compile }
|
||||
! PR fortran/103412
|
||||
|
||||
program p
|
||||
integer, parameter :: a = sizeof(z'1') ! { dg-error "cannot be an actual" }
|
||||
end
|
Loading…
Add table
Reference in a new issue