From patchwork Sun Jul 4 06:06:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Kargl X-Patchwork-Id: 57828 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id F0ED7B6F0E for ; Sun, 4 Jul 2010 16:06:25 +1000 (EST) Received: (qmail 3273 invoked by alias); 4 Jul 2010 06:06:21 -0000 Received: (qmail 3254 invoked by uid 22791); 4 Jul 2010 06:06:20 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.208.78.105) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 04 Jul 2010 06:06:16 +0000 Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id o6466ER8045096; Sat, 3 Jul 2010 23:06:14 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id o6466EoO045095; Sat, 3 Jul 2010 23:06:14 -0700 (PDT) (envelope-from sgk) Date: Sat, 3 Jul 2010 23:06:14 -0700 From: Steve Kargl To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] fortran/44797 -- inquire's exist shall be default logical Message-ID: <20100704060614.GA45076@troutmask.apl.washington.edu> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 PR fortran/44797 * fortran/io.c (resolve_tag): Check EXIST is a default logical. 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",