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]

[PATCH] fortran/44797 -- inquire's exist shall be default logical


The standard requires a default logical for the EXIST
tag in an inquire statement.  gfortran has an extension
to accept any logical kind.  However, if -std=f95 or
-std=f2003 is given gfortran does not issue an error.
This patch fixes that shortcoming.

OK for trunk?
 
2010-07-03  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/44797
	* fortran/io.c (resolve_tag): Check EXIST is a default logical.

-- 
Steve
Index: io.c
===================================================================
--- io.c	(revision 161480)
+++ io.c	(working copy)
@@ -1497,6 +1497,14 @@ resolve_tag (const io_tag *tag, gfc_expr
 	return FAILURE;
     }
 
+  if (tag == &tag_exist && e->ts.kind != gfc_default_logical_kind)
+    {
+      if (gfc_notify_std (GFC_STD_GNU, "default LOGICAL required "
+			  "in %s tag at %L", tag->name, &e->where)
+	  == FAILURE)
+	return FAILURE;
+    }
+
   if (tag == &tag_convert)
     {
       if (gfc_notify_std (GFC_STD_GNU, "Extension: CONVERT tag at %L",

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