This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran 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.
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=ojMLWMU15LFRdj1DY8NAYCtA8Vrs7p3HLognJ7ladvQ=; b=aOAGPDi2EnmZ62ABEPq9GoDsKC/gZAEaxSEcu3rOywaPhiNsbdCXLxKAPe0THVDirikhZc5PsmNCnEvmluT9+hhuirgnqvbOXcGmQfTxu8GKXF4izaTopeQ++I1TnBZ6xwrFY86JGvw4tv1Cm2622omtcImkvoG+N0bQ4LhqfCg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=EIMwCqx3afNdgmEH7Q1+719k3OTAU3qfFgtK7U1FVtj1sPQWDj7jP7Q24EWm9p7G3q69YH9in979rYEJb4wBJVFOnSI6Q+ngNCRHy9pHlbBmLZ6xw9PVirbySUgHJaTA1OWO+xEej+zlwtqRooKsddcxIeIt/Zophd/rTuVWAQw=
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