Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2197015/?format=api
{ "id": 2197015, "url": "http://patchwork.ozlabs.org/api/patches/2197015/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260216212532.1827452-1-gonzalo.silvalde@gmail.com/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260216212532.1827452-1-gonzalo.silvalde@gmail.com>", "list_archive_url": null, "date": "2026-02-16T21:25:32", "name": "[v2] Fortran: Fix diagnostic for ambiguous pointer function assignment [PR80012]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "cf0414a54184b9cfa2fd366935ba2fa54ddda4ad", "submitter": { "id": 92648, "url": "http://patchwork.ozlabs.org/api/people/92648/?format=api", "name": "Gonzalosilvalde", "email": "gonzalo.silvalde@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260216212532.1827452-1-gonzalo.silvalde@gmail.com/mbox/", "series": [ { "id": 492352, "url": "http://patchwork.ozlabs.org/api/series/492352/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=492352", "date": "2026-02-16T21:25:32", "name": "[v2] Fortran: Fix diagnostic for ambiguous pointer function assignment [PR80012]", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/492352/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2197015/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2197015/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=KgF1VPzO;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=KgF1VPzO", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "sourceware.org; spf=pass smtp.mailfrom=gmail.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=209.85.221.65" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fFG754WrQz1xpl\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 17 Feb 2026 08:26:40 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 67E994BA23F2\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 16 Feb 2026 21:26:38 +0000 (GMT)", "from mail-wr1-f65.google.com (mail-wr1-f65.google.com\n [209.85.221.65])\n by sourceware.org (Postfix) with ESMTPS id 0BE784BA23E8\n for <gcc-patches@gcc.gnu.org>; Mon, 16 Feb 2026 21:25:47 +0000 (GMT)", "by mail-wr1-f65.google.com with SMTP id\n ffacd0b85a97d-4358fb60802so2636309f8f.1\n for <gcc-patches@gcc.gnu.org>; Mon, 16 Feb 2026 13:25:46 -0800 (PST)", "from gonzalo.gonzalo ([178.60.12.162])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43796ac8209sm31371905f8f.30.2026.02.16.13.25.44\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 16 Feb 2026 13:25:45 -0800 (PST)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 67E994BA23F2", "OpenDKIM Filter v2.11.0 sourceware.org 0BE784BA23E8" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 0BE784BA23E8", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 0BE784BA23E8", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771277147; cv=none;\n b=lcohXZcRKsQ3ocB5RdRdHSBfIAzynIV3I1r8oqijqfIgTkNtCCyQRcXQ87PZGhlWGMs/uOzT+Q49h1vUV/YGEMdagOV7kWsfJn7ipbiBXkoAAnpI+bLLUAe6/nIy38FjEY/HWdMx2GQqa+ZeuF1VzYps4ftpVKZ7D7xdPJMmYU0=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1771277147; c=relaxed/simple;\n bh=ajKV1eMx7fYpIz/9BEpMSJpGLBRrrtPidkOH7etHoas=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=m2RBN3AiSPYD+AzCgj+TgchKNWMNpZC2EiJHRh3C11iGnIKCHTF31MFcp+Ws3ExwD8z0bolXU8zJnFQ5axd3BZUkHxPIkNyqJXO1PQ9w/fKbxdTlYITL+Pmr3rc3NgmjnkhtDat8aJi8qKVvecw+nHf/y8Od2lrVqipIrwc+DmE=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1771277146; x=1771881946; darn=gcc.gnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=sgZrczZZcV3BEhzoeJ9Z035lJc5d/hLFRRAETViT+D4=;\n b=KgF1VPzOpN/o28XbcXYqedEeqFQw5LKyuccy1D7buGrPqF2wk9d5AXS8l9bXFflWAf\n 0hAzXe42GMCfXfVBUuLIuJpc6ybdkcMPmkMrP2oxtSb774grhwC8z32KnsVxfOl1Yk6L\n +HuJRokruMXVguYgotEoprFboBtvFga14c8NZneEGh6Z/QdmeVxpuy9InjwrIpM3kSwk\n I8WUgq5JxpW3bs7rq7d7S6tnitXKSKx34eLN2G0gDUYr8TvnmfWXlSFux9OquYWKX+rr\n fy3LjJpTRG1sJFsauIrscbZm/2KFnjsCmX0ffyMOtt6deaTIgFq7EnrImDXIec2svr1S\n 0ZJA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1771277146; x=1771881946;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=sgZrczZZcV3BEhzoeJ9Z035lJc5d/hLFRRAETViT+D4=;\n b=I4ihqswEtWz7ajrM7YT50eFcID7NW1hJhM8SE2PH7XjBeeVJuAf3/TVfBpgVFqpo5g\n 7PV9lXz67usoJqOf/2q1E2mQCfAVKeWGgHfRrkXmeNXQgDksIZ0r+NNOcMCu6Ww9ckD6\n v6YwBwrOQbc8ZxjUO1xTBv6uOSTgrGidOOliYvQAj+NhfHgCJenzuNs3XMaioOpJjQOk\n q34GVwqX2MoiQHku6a+eMvHeX4QrqMAd890S4snBCq2ScYvfA8vuWw9PF/Es/Iub79uk\n NWweoO5hQxTS1LnANi3+7qCijzOqXZtZe5yenUTCriKvuTgSW3sYqBrUbedoFwpCEx2H\n s53A==", "X-Gm-Message-State": "AOJu0YwZ3deHUi8dKTKycgNVXcsNTPWBObGFPoAURl4e6A00L2GzQTBX\n TD2N4VsK3YkW/q4Chv2VZ/6yNn+du/ik7z//jram1BI6CPY1JVDU9U2vKuV4C8SN", "X-Gm-Gg": "AZuq6aLDtqj4qcw3a/r5EWccXcKfFYhPHrwQ/8xdihDgL9rBiHj6tu9JYGJN2A2zT0g\n jhBXdUHktMaQLPL6oC8VvATsgQiPNGF8kkPgntd2T+jFcL5kE2yI7mcHTi0T68wxO/dA0jFxgpR\n D/coh7+T8WeLh6D71WIludSXhRy/MQiP7gPNzJ6Nxf4uKyAMNTOuPF/oC3YKJVYwAx5LzmzEJck\n 1iwsvaE5TxHutrDx0icdJBaypefr3T2Rb266oynUFg5a2Xr21s27YBWzEkEUfcUE7lObUD3wrP3\n r+5ymALi/tvwSr2I+AikfPLt0CmyfeVIBgXuTOFHMwbdlMVqVgbSfHDEz/NDGh5/HiPSc9JHc3u\n kZ71k6uuU1VpKD3nJhvLnKx8FFwojBXZp5T+LHcEOnHP6hF3H7BhnW1TozcDB5vJFz55vpmpDNJ\n EcXQFgZ7iBKiZ46kfz2U97xC+YOnvRSJY3NyQ=", "X-Received": "by 2002:a05:6000:2403:b0:436:339a:9ab2 with SMTP id\n ffacd0b85a97d-4379d5e3c6fmr17777402f8f.7.1771277145633;\n Mon, 16 Feb 2026 13:25:45 -0800 (PST)", "From": "Gonzalosilvalde <gonzalo.silvalde@gmail.com>", "To": "gcc-patches@gcc.gnu.org", "Cc": "fortran@gcc.gnu.org, anlauf@gmx.de,\n Gonzalosilvalde <gonzalo.silvalde@gmail.com>", "Subject": "[PATCH v2] Fortran: Fix diagnostic for ambiguous pointer function\n assignment [PR80012]", "Date": "Mon, 16 Feb 2026 22:25:32 +0100", "Message-ID": "<20260216212532.1827452-1-gonzalo.silvalde@gmail.com>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<d6c3c204-653b-48b7-ae1a-c9490cf48e3b@gmx.de>", "References": "<d6c3c204-653b-48b7-ae1a-c9490cf48e3b@gmx.de>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "gcc-patches@gcc.gnu.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>", "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>", "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "The error message for an ambiguous pointer function assignment contained\na FIXME and an embedded newline that the diagnostics printer does not\nhandle. Split the single gfc_error call into a gfc_error for the main\ndiagnostic and an inform note for the F2008 explanation, wrapped in an\nauto_diagnostic_group.\n\n\tPR fortran/80012\n\ngcc/fortran/ChangeLog:\n\n\t* symbol.cc: Include diagnostic-core.h.\n\t(gfc_add_procedure): Split error into gfc_error and inform\n\tusing auto_diagnostic_group.\n\ngcc/testsuite/ChangeLog:\n\n\t* gfortran.dg/pr80012.f90: New test.\n\nSigned-off-by: Gonzalosilvalde <gonzalo.silvalde@gmail.com>\n---\nHi Harald,\n\nThanks for the quick review. Here is the patch with the suggestion.\n\n gcc/fortran/symbol.cc | 23 ++++++++++++-----------\n gcc/testsuite/gfortran.dg/pr80012.f90 | 14 ++++++++++++++\n 2 files changed, 26 insertions(+), 11 deletions(-)\n create mode 100644 gcc/testsuite/gfortran.dg/pr80012.f90", "diff": "diff --git a/gcc/fortran/symbol.cc b/gcc/fortran/symbol.cc\nindex 5a68f44ca63..a1f1b151a96 100644\n--- a/gcc/fortran/symbol.cc\n+++ b/gcc/fortran/symbol.cc\n@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see\n #include \"coretypes.h\"\n #include \"options.h\"\n #include \"gfortran.h\"\n+#include \"diagnostic-core.h\"\n #include \"parse.h\"\n #include \"match.h\"\n #include \"constructor.h\"\n@@ -1886,19 +1887,19 @@ gfc_add_procedure (symbol_attribute *attr, procedure_type t,\n if (attr->proc != PROC_UNKNOWN && !attr->module_procedure\n && attr->access == ACCESS_UNKNOWN)\n {\n+ auto_diagnostic_group d;\n+ gfc_error (\"%s procedure at %L is already declared as %s procedure\",\n+\t gfc_code2string (procedures, t), where,\n+\t gfc_code2string (procedures, attr->proc));\n if (attr->proc == PROC_ST_FUNCTION && t == PROC_INTERNAL\n \t && !gfc_notification_std (GFC_STD_F2008))\n-\tgfc_error (\"%s procedure at %L is already declared as %s \"\n-\t\t \"procedure. \\nF2008: A pointer function assignment \"\n-\t\t \"is ambiguous if it is the first executable statement \"\n-\t\t \"after the specification block. Please add any other \"\n-\t\t \"kind of executable statement before it. FIXME\",\n-\t\t gfc_code2string (procedures, t), where,\n-\t\t gfc_code2string (procedures, attr->proc));\n- else\n-\tgfc_error (\"%s procedure at %L is already declared as %s \"\n-\t\t \"procedure\", gfc_code2string (procedures, t), where,\n-\t\t gfc_code2string (procedures, attr->proc));\n+\t{\n+\tinform (gfc_get_location (where),\n+\t\t\"F2008: A pointer function assignment is ambiguous if it is \"\n+\t\t\"the first executable statement after the specification \"\n+\t\t\"block. Please add any other kind of executable \"\n+\t\t\"statement before it\");\n+\t}\n \n return false;\n }\ndiff --git a/gcc/testsuite/gfortran.dg/pr80012.f90 b/gcc/testsuite/gfortran.dg/pr80012.f90\nnew file mode 100644\nindex 00000000000..da626d565d8\n--- /dev/null\n+++ b/gcc/testsuite/gfortran.dg/pr80012.f90\n@@ -0,0 +1,14 @@\n+! { dg-do compile }\n+! { dg-options \"-std=gnu\" }\n+! PR fortran/80012\n+! Test that the error message for ambiguous pointer function assignment\n+! is split into an error and an informational note, without FIXME.\n+\n+two() = 7\n+contains\n+ function two () ! { dg-error \"INTERNAL-PROC procedure at .1. is already declared as STATEMENT-PROC procedure\" }\n+! { dg-message \"F2008: A pointer function assignment is ambiguous\" \"\" { target *-*-* } 9 }\n+ integer, pointer :: two\n+ allocate(two)\n+ end function two\n+end\n", "prefixes": [ "v2" ] }