diff options
author | Daniel Franke <dfranke@gcc.gnu.org> | 2007-07-14 09:33:51 -0400 |
---|---|---|
committer | Daniel Franke <dfranke@gcc.gnu.org> | 2007-07-14 09:33:51 -0400 |
commit | dec9e22db11897ee4bda060bd9169d612144d37e (patch) | |
tree | 8c7265dc012fab442ec466a4fb282ad369eb1b35 | |
parent | 8d1341f797149e33a9cee62b90cc9055b7c542b9 (diff) | |
download | gcc-dec9e22db11897ee4bda060bd9169d612144d37e.zip gcc-dec9e22db11897ee4bda060bd9169d612144d37e.tar.gz gcc-dec9e22db11897ee4bda060bd9169d612144d37e.tar.bz2 |
re PR fortran/32724 (ICE on statement function in specification part of module)
gcc/fortran:
2007-07-14 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32724
* parse.c (parse_spec): Emit error on unexpected statement
function.
gcc/testsuite:
2007-07-14 Daniel Franke <franke.daniel@gmail.com>
PR fortran/32724
* gfortran.dg/stfunc_5.f90: New test.
From-SVN: r126638
-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" } } + |