diff options
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/parse.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/stfunc_5.f90 | 11 |
4 files changed, 29 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9b0a0a4..3c72673 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2007-07-14 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/32724 + * parse.c (parse_spec): Emit error on unexpected statement + function. + 2007-07-13 Daniel Franke <franke.daniel@gmail.com> * invoke.texi: Unified upper- and lower-case in menus. diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index f1f9028..df31bcd 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -1902,6 +1902,13 @@ loop: break; + case ST_STATEMENT_FUNCTION: + if (gfc_current_state () == COMP_MODULE) + { + unexpected_statement (st); + break; + } + default: break; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f84bffc..e858484 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-07-14 Daniel Franke <franke.daniel@gmail.com> + + PR fortran/32724 + * gfortran.dg/stfunc_5.f90: New test. + 2007-07-14 Uros Bizjak <ubizjak@gmail.com> * lib/target-supports.exp (check_effective_target_vect_aligned_arrays): diff --git a/gcc/testsuite/gfortran.dg/stfunc_5.f90 b/gcc/testsuite/gfortran.dg/stfunc_5.f90 new file mode 100644 index 0000000..09b6da3 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/stfunc_5.f90 @@ -0,0 +1,11 @@ +! { dg-do compile } +! +! PR fortran/32724 +! ICE on statement function in specification part of module + +MODULE stmt +f(x) = x**2 ! { dg-error "Unexpected STATEMENT FUNCTION" } +END MODULE + +! { dg-final { cleanup-modules "stmt" } } + |