]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/55362 (ICE with size() on character pointer)
authorPaul Thomas <pault@gcc.gnu.org>
Sat, 9 Feb 2013 09:49:49 +0000 (09:49 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Sat, 9 Feb 2013 09:49:49 +0000 (09:49 +0000)
2013-02-09  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/55362
* check.c (array_check): It is an error if a procedure is
passed.

2013-02-09  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/55362
* gfortran.dg/intrinsic_size_4.f90 : New test.

From-SVN: r195915

gcc/fortran/ChangeLog
gcc/fortran/check.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/intrinsic_size_4.f90 [new file with mode: 0644]

index 6505704a9652bbe211fe83e03fc391ef00c3f387..52b610dab03fb6552a6f435b21f87f584417e8ce 100644 (file)
@@ -1,3 +1,9 @@
+2013-02-09  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/55362
+       * check.c (array_check): It is an error if a procedure is
+       passed.
+
 2013-02-08  Mikael Morin  <mikael@gcc.gnu.org>
 
        PR fortran/54107
@@ -8,7 +14,7 @@
 
 2013-02-07  Tobias Burnus  <burnus@net-b.de>
 
-       PR fortran/54339 
+       PR fortran/54339
        * gfortran.texi (Standards): Mention TS29113.
        (Varying Length Character): Mention deferred-length
        strings.
index 8bd06457ff4878f76ac4df5e57ac9f63c4b3ee9c..0e71b9506f86246824d9b7569247efe639051942 100644 (file)
@@ -256,7 +256,7 @@ array_check (gfc_expr *e, int n)
       return SUCCESS;
     }
 
-  if (e->rank != 0)
+  if (e->rank != 0 && e->ts.type != BT_PROCEDURE)
     return SUCCESS;
 
   gfc_error ("'%s' argument of '%s' intrinsic at %L must be an array",
index 557c8fef5d2cb7df0dd8f50a45fd166083562c10..69d7a15d2adebcde9d9ca984b28a02abb38fc652 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-09  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/55362
+       * gfortran.dg/intrinsic_size_4.f90 : New test.
+
 2013-02-09  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/56256
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_size_4.f90 b/gcc/testsuite/gfortran.dg/intrinsic_size_4.f90
new file mode 100644 (file)
index 0000000..6d8e1c0
--- /dev/null
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! Test the fix for PR55362; the error below was missed and an ICE ensued.
+!
+! ! Contributed by Dominique d'Humieres  <dominiq@lps.ens.fr>
+!
+program ice_test
+  implicit none
+  write(*,*) 'message: ', &
+             size(Error_Msg),Error_Msg()     ! { dg-error "must be an array" }
+  write(*,*) 'message: ', &
+             size(Error_Msg ()),Error_Msg()  ! OK of course
+contains
+  function Error_Msg() result(ErrorMsg)
+    character, dimension(:), pointer :: ErrorMsg
+    character, dimension(1), target :: str = '!'
+    ErrorMsg => str
+  end function Error_Msg
+end program ice_test