From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1534) id 3E22E3858D1E; Tue, 20 Jun 2023 11:23:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E22E3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687260233; bh=Ue4wyh6+M7VNL+hIZKlpSkGZG88paTMExBPlSwvL8TM=; h=From:To:Subject:Date:From; b=bSpAjcB1pNR/dVQSavWuundSDAHPQBj/VlPhnvEcoR/qdQxo0ncvetolujfMT7tor vZxa9hG3QozXNmWyWMWCGqdNwoCOoJfuzf/RCtHDuvyLCNUMbpfXfT0uRNYVL69oyJ TwLNTEYg1DNeeR9KNJiVRqica8a74KsFO1ta8LvQ= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Tobias Burnus To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1983] Fortran's gfc_match_char: %S to match symbol with host_assoc X-Act-Checkin: gcc X-Git-Author: Tobias Burnus X-Git-Refname: refs/heads/master X-Git-Oldrev: 9d597e00757eedfb6b6cf5e0b5138b8029aeb28e X-Git-Newrev: 0607e93490058ec31b6ab57078c54771f139b870 Message-Id: <20230620112353.3E22E3858D1E@sourceware.org> Date: Tue, 20 Jun 2023 11:23:53 +0000 (GMT) List-Id: https://gcc.gnu.org/g:0607e93490058ec31b6ab57078c54771f139b870 commit r14-1983-g0607e93490058ec31b6ab57078c54771f139b870 Author: Tobias Burnus Date: Tue Jun 20 13:23:40 2023 +0200 Fortran's gfc_match_char: %S to match symbol with host_assoc gfc_match ("... %s ...", ...) matches a gfc_symbol but with host_assoc = 0. This commit adds '%S' as variant which matches with host_assoc = 1 gcc/fortran/ChangeLog: * match.cc (gfc_match_char): Match with '%S' a symbol with host_assoc = 1. Diff: --- gcc/fortran/match.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc index e7be7fddc64..1203787fe77 100644 --- a/gcc/fortran/match.cc +++ b/gcc/fortran/match.cc @@ -1084,7 +1084,8 @@ gfc_match_char (char c, bool gobble_ws) %% Literal percent sign %e Expression, pointer to a pointer is set - %s Symbol, pointer to the symbol is set + %s Symbol, pointer to the symbol is set (host_assoc = 0) + %S Symbol, pointer to the symbol is set (host_assoc = 1) %n Name, character buffer is set to name %t Matches end of statement. %o Matches an intrinsic operator, returned as an INTRINSIC enum. @@ -1151,8 +1152,9 @@ loop: goto loop; case 's': + case 'S': vp = va_arg (argp, void **); - n = gfc_match_symbol ((gfc_symbol **) vp, 0); + n = gfc_match_symbol ((gfc_symbol **) vp, c == 'S'); if (n != MATCH_YES) { m = n;