From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp-30.smtpout.orange.fr [80.12.242.30]) by sourceware.org (Postfix) with ESMTPS id 9EF463858CDB for ; Sun, 30 Oct 2022 21:25:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9EF463858CDB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orange.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=orange.fr Received: from [192.168.1.17] ([86.215.174.255]) by smtp.orange.fr with ESMTPA id pFnuopKbnr5PdpFnuoIQFJ; Sun, 30 Oct 2022 22:25:16 +0100 X-ME-Helo: [192.168.1.17] X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Sun, 30 Oct 2022 22:25:16 +0100 X-ME-IP: 86.215.174.255 Message-ID: <327319ac-4ef9-1e48-e993-57113d802d3b@orange.fr> Date: Sun, 30 Oct 2022 22:25:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH] Fortran: ordering of hidden procedure arguments [PR107441] Content-Language: fr From: Mikael Morin To: Harald Anlauf , fortran , gcc-patches References: <7d8ddf07-e66d-2678-de99-0e575c70ea17@orange.fr> In-Reply-To: <7d8ddf07-e66d-2678-de99-0e575c70ea17@orange.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,FREEMAIL_FROM,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Le 30/10/2022 à 20:23, Mikael Morin a écrit : > Another probable issue is your change to create_function_arglist changes > arglist/hidden_arglist without also changing typelist/hidden_typelist > accordingly.  I think a change to gfc_get_function_type is also > necessary: as the function decl is changed, the decl type need to be > changed as well. > > I will see whether I can manage to exhibit testcases for these issues. > Here is a test for the type vs decl mismatch. ! { dg-do run } ! ! PR fortran/107441 ! Check that procedure types and procedure decls match when the procedure ! has both chaacter-typed and optional value args. program p interface subroutine i(c, o) character(*) :: c integer, optional, value :: o end subroutine i end interface procedure(i), pointer :: pp call pp("abcd") contains subroutine s(c, o) character(*) :: c integer, optional, value :: o if (present(o)) stop 1 if (len(c) /= 4) stop 2 if (c /= "abcd") stop 3 end subroutine s end program p