diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index e68eff8bdbb..17fd92eb462 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -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); diff --git a/gcc/testsuite/gfortran.dg/null_11.f90 b/gcc/testsuite/gfortran.dg/null_11.f90 new file mode 100644 index 00000000000..040cc260b5d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/null_11.f90 @@ -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