This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[fortran,patch] Fix PR33957, rejects valid init. expr.
- From: "François-Xavier Coudert" <fxcoudert at gmail dot com>
- To: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 9 Nov 2007 18:33:44 +0000
- Subject: [fortran,patch] Fix PR33957, rejects valid init. expr.
Patch below fixes PR33957, a rejects-valid bug: it does so by not
emitting an error in check_inquiry() when we don't recognize a
function as an inquiry function, but simply bailing out. When
appropriate, an error will be emitted from the function that called
check_inquiry(). And anyway, I think this error message doesn't make
sense: we say that "inquiry function 'FOO' is not permitted in an
init. expr.", when in fact we did not recognize FOO as an inquiry
function.
Regtested on x86_64-linux, will come with a testcase & ChangeLog, OK to commit?
FX
Index: expr.c
===================================================================
--- expr.c (revision 129869)
+++ expr.c (working copy)
@@ -1981,11 +1981,7 @@ check_inquiry (gfc_expr *e, int not_rest
break;
if (functions[i] == NULL)
- {
- gfc_error ("Inquiry function '%s' at %L is not permitted "
- "in an initialization expression", name, &e->where);
- return MATCH_ERROR;
- }
+ return MATCH_ERROR;
/* At this point we have an inquiry function with a variable argument. The
type of the variable might be undefined, but we need it now, because the