Fortran: Fix intrinsic null() handling [PR99651]

gcc/fortran/ChangeLog:

	PR fortran/99651
	* intrinsic.c (gfc_intrinsic_func_interface): Set
	attr.proc = PROC_INTRINSIC if FL_PROCEDURE.

gcc/testsuite/ChangeLog:

	PR fortran/99651
	* gfortran.dg/null_11.f90: New test.
This commit is contained in:
Tobias Burnus 2021-03-26 08:39:24 +01:00
parent 4493b1c1ad
commit 9d45e848d0
2 changed files with 21 additions and 0 deletions

View File

@ -5071,6 +5071,11 @@ got_specific:
sym->attr.intrinsic = 1;
sym->attr.flavor = FL_PROCEDURE;
}
if (sym->attr.flavor == FL_PROCEDURE)
{
sym->attr.function = 1;
sym->attr.proc = PROC_INTRINSIC;
}
if (!sym->module)
gfc_intrinsic_symbol (sym);

View File

@ -0,0 +1,16 @@
! { dg-do compile }
!
! PR fortran/99651
!
module m
type :: CHAR_STAR
character(len=1),dimension(:),pointer :: ptr
end type
type(CHAR_STAR), parameter ::CHAR_STAR_NULL = CHAR_STAR(NULL())
end module m
use m
type typeNode
type(typeNode), pointer :: Next => null()
end type typeNode
end