diff options
author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-22 00:05:10 +0000 |
---|---|---|
committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-22 00:05:10 +0000 |
commit | 994f2db2bcbc59e819ffd0641a5133c465932b64 (patch) | |
tree | 7917653e404c26436bdce630f8d57f59116c5d61 /gcc/testsuite/gfortran.dg/auto_char_len_4.f90 | |
parent | 4330d815716d2f641d9237493d81e9487f738e3e (diff) | |
download | gcc-994f2db2bcbc59e819ffd0641a5133c465932b64.tar.gz |
2006-11-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25087
* resolve.c (resolve_fl_procedure): Add an error if an external
automatic character length function does not have an explicit
interface.
2006-11-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25087
* gfortran.dg/auto_char_len_4.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119077 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg/auto_char_len_4.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/auto_char_len_4.f90 | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/auto_char_len_4.f90 b/gcc/testsuite/gfortran.dg/auto_char_len_4.f90 new file mode 100644 index 00000000000..3749abd8ed3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/auto_char_len_4.f90 @@ -0,0 +1,24 @@ +! { dg-do compile } +! Tests the fix for PR25087, in which the following invalid code +! was not detected. +! +! Contributed by Joost VandeVondele <jv244@cam.ac.uk> +! +SUBROUTINE s(n) + CHARACTER(LEN=n), EXTERNAL :: a ! { dg-error "must have an explicit interface" } + interface + function b (m) ! This is OK + CHARACTER(LEN=m) :: b + integer :: m + end function b + end interface + write(6,*) a(n) + write(6,*) b(n) + write(6,*) c() +contains + function c () ! This is OK + CHARACTER(LEN=n):: c + c = "" + end function c +END SUBROUTINE s + |