This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[patch, fortran] PR32724 - ICE on statement function in specification part of module
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 14 Jul 2007 14:25:49 +0200
- Subject: [patch, fortran] PR32724 - ICE on statement function in specification part of module
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:to:subject:date:user-agent:cc:mime-version:content-type:message-id; b=CXdBl8jB9bv6FpsJpSyDc93V6vYvI/+BSCEuHkzGdEVUJ4UarQU310CEKX55EXGxvb8ptLdihX5IBXJLfCOL74fQB4yXOs1uTZ6Qt3tlF7iOuJlA7Mj0QRwH/6ZqRwoxekGVRDinSxpssnwsElqO4cpK2L1A8QBrwWZZD9nfsp4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:to:subject:date:user-agent:cc:mime-version:content-type:message-id; b=aPiovgtkNybkyfsy70ee1hiuLIUmF8O87Ah1XAnfKSFXJQgIParqDHcMGwyfjRtU+RC/VACSy8OL6E521TwSsTCSfQlkkK8W3+ABzlDCOkincVO+sskGYtmVhJwStY6avI74WJvIsV1NNN8F/rGIliZuW8hPcZucqTmOanQ18CI=
On Paul's behalf:
2007-07-14 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32724
* parse.c (parse_spec): Emit error on unexpected statement function.
Regression tested on i686-pc-linux-gnu by myself.
Ok for trunk?
Regards
Daniel
Index: fortran/parse.c
===================================================================
--- fortran/parse.c (revision 126614)
+++ fortran/parse.c (working copy)
@@ -1902,6 +1902,13 @@
break;
+ case ST_STATEMENT_FUNCTION:
+ if (gfc_current_state () == COMP_MODULE)
+ {
+ unexpected_statement (st);
+ break;
+ }
+
default:
break;
}
Index: testsuite/gfortran.dg/stfunc_5.f90
===================================================================
--- testsuite/gfortran.dg/stfunc_5.f90 (revision 0)
+++ testsuite/gfortran.dg/stfunc_5.f90 (revision 0)
@@ -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" } }
+