This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]