]> gcc.gnu.org Git - gcc.git/commitdiff
Fortran: Fix intrinsic null() handling [PR99651]
authorTobias Burnus <tobias@codesourcery.com>
Fri, 26 Mar 2021 07:39:24 +0000 (08:39 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Fri, 26 Mar 2021 07:39:24 +0000 (08:39 +0100)
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.

gcc/fortran/intrinsic.c
gcc/testsuite/gfortran.dg/null_11.f90 [new file with mode: 0644]

index e68eff8bdbbf5ce6ef994fc17ad53ba5f772c49f..17fd92eb462973ffe5ac7718d05016c5b9c311c3 100644 (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);
diff --git a/gcc/testsuite/gfortran.dg/null_11.f90 b/gcc/testsuite/gfortran.dg/null_11.f90
new file mode 100644 (file)
index 0000000..040cc26
--- /dev/null
@@ -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
This page took 0.102057 seconds and 5 git commands to generate.