From patchwork Fri Dec 2 15:24:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janus Weil X-Patchwork-Id: 702009 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tVdHh52BMz9t1B for ; Sat, 3 Dec 2016 02:24:48 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="I4WQeqMs"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=ptA57GbQf6GVSpOSaKcvJGS2JyR9AXuZJclSNa8LKvGLEb nVqVLX20G7KwhfNVhSu8wPXNeR+TaXjZwAedcmOnlQY/+sqhvAWBpvuqns+qTBc1 FxKWpeMLvswmX96uexw2xqUHZTB/2OtSgVG9TR9dEXnuu0wJcevfKvl1hp+qk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=40jAkodiyaW+e9KGAvWzOlG5CKU=; b=I4WQeqMsnM+I2ilTrmZK E8WLRqLI6vlboyaAwGclzD9L4wbCGxMva3qPRPvq+QWtF/6cJq7KRj/i43rFqOip TCOlZ0nYzXWRgF+P9BdOLna71NkK8WQeAhF8XdrLLbdqtpZjTlBX7ZnDaN+6lHhK RNYd2YIMn6h7njUR94NaHdo= Received: (qmail 14199 invoked by alias); 2 Dec 2016 15:24:31 -0000 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 Received: (qmail 14120 invoked by uid 89); 2 Dec 2016 15:24:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL, BAYES_20, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=no version=3.3.2 spammy=243176, primaryc, regtests, sk:gfc_mat X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-yw0-f169.google.com Received: from mail-yw0-f169.google.com (HELO mail-yw0-f169.google.com) (209.85.161.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Dec 2016 15:24:24 +0000 Received: by mail-yw0-f169.google.com with SMTP id a10so219149842ywa.3; Fri, 02 Dec 2016 07:24:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=DC5M6J8ezq85jBIaQOnLrJE9ZSSWnBSnVTVNbhkYQk4=; b=FWVa8+sX2+BF+HAAwz+wPNKOdQ8eyM9tTY+QTLjhKDfttV7yS3CGE0kKVMNO37hLIm xtKyzCc1tzv1U4qQgldWNQCGmTLJuMcdeSjaSXkDENjIAM1u1U5uwOsaSPH/mjdvBycc 0uVH9iIk4KC457QkeSEg59ECNVAJzajanDvTtWJjbvNHBoYY9l/TIxv41DE61LgIDEOy o6Kvt+qhK6sPvzXNKm/DHn6wbjSlSqrx0fISerCoYGY0hPdXkLHhHkgUTe56Lk6ua0Ny NcXDUEXZLi3JT+AgfPFt1CO+RiCNLFPdAVZjKU5XntGGHlFVfMioaXUpGPqVOB7G+E4a synw== X-Gm-Message-State: AKaTC02bvOpzvmi+Js25F5dxk7Infwlv5ddhv/TO5FOQW7vPtJCJlYB3knoCCw5zCxWvfwBN5cYIybLTHoH+5A== X-Received: by 10.13.226.85 with SMTP id l82mr44859151ywe.43.1480692261209; Fri, 02 Dec 2016 07:24:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.51.145 with HTTP; Fri, 2 Dec 2016 07:24:20 -0800 (PST) From: Janus Weil Date: Fri, 2 Dec 2016 16:24:20 +0100 Message-ID: Subject: [Patch, Fortran, OOP] PR 42188: F03:C612. The leftmost part-name shall be the name of a data object To: gfortran , gcc-patches Hi all, another simple fix for a rather old PR. This one adds a new check, in order to provide better error messages than just "Unclassifiable statement". Regtests cleanly on x86_64-linux-gnu. Ok for trunk? Cheers, Janus 2016-12-02 Janus Weil PR fortran/42188 * primary.c (gfc_match_rvalue): Add a new check that gives better error messages. 2016-12-02 Janus Weil PR fortran/42188 * gfortran.dg/derived_result_2.f90.f90: New test case. Index: gcc/fortran/primary.c =================================================================== --- gcc/fortran/primary.c (revision 243176) +++ gcc/fortran/primary.c (working copy) @@ -3298,6 +3298,15 @@ gfc_match_rvalue (gfc_expr **result) if (sym->result == NULL) sym->result = sym; + gfc_gobble_whitespace (); + /* F08:C612. */ + if (gfc_peek_ascii_char() == '%') + { + gfc_error ("The leftmost part-ref in a data-ref can not be a " + "function reference at %C"); + m = MATCH_ERROR; + } + m = MATCH_YES; break;