Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2196642/?format=api
{ "id": 2196642, "url": "http://patchwork.ozlabs.org/api/patches/2196642/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260215181052.741693-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": "<20260215181052.741693-1-gonzalo.silvalde@gmail.com>", "list_archive_url": null, "date": "2026-02-15T18:10:52", "name": "Fortran: Fix diagnostic for ambiguous pointer function assignment [PR80012]", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "da50e10441158e92b2e2555eaa8678d3bb03c5e1", "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/20260215181052.741693-1-gonzalo.silvalde@gmail.com/mbox/", "series": [ { "id": 492230, "url": "http://patchwork.ozlabs.org/api/series/492230/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=492230", "date": "2026-02-15T18:10:52", "name": "Fortran: Fix diagnostic for ambiguous pointer function assignment [PR80012]", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/492230/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2196642/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2196642/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=WwbD3srF;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.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=WwbD3srF", "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.66" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 4fDYsM20gjz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 16 Feb 2026 05:12:23 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 19F694B9DB55\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 15 Feb 2026 18:12:21 +0000 (GMT)", "from mail-wr1-f66.google.com (mail-wr1-f66.google.com\n [209.85.221.66])\n by sourceware.org (Postfix) with ESMTPS id 1B4A64BA23FB\n for <gcc-patches@gcc.gnu.org>; Sun, 15 Feb 2026 18:11:48 +0000 (GMT)", "by mail-wr1-f66.google.com with SMTP id\n ffacd0b85a97d-436e87589e8so3047443f8f.3\n for <gcc-patches@gcc.gnu.org>; Sun, 15 Feb 2026 10:11:48 -0800 (PST)", "from gonzalo.gonzalo ([178.60.12.162])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-48370ac3564sm179182135e9.5.2026.02.15.10.11.45\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 15 Feb 2026 10:11:46 -0800 (PST)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 19F694B9DB55", "OpenDKIM Filter v2.11.0 sourceware.org 1B4A64BA23FB" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 1B4A64BA23FB", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 1B4A64BA23FB", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771179108; cv=none;\n b=Dd+uM8DyMPOWyIJUrzdRnhCZ02HWkKgxaYcuq0eaa6epDBM5/xFQAB6PIMCC3ImJOcda7YeK/zQtyf6UyMhTHfmYXEK6+64jvICA02ouDMZmi94r2bd7PBzS4v3EdlINIw7rjLw2mXpcl4ghL3f4rFTzUj7WvkThbultCguo5N4=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1771179108; c=relaxed/simple;\n bh=5wlnAHsJkIhrHDwwkRe+61D2iGmKV5PpoV2JRpqLHYs=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=qlwmuTdtT+8UC/37+iCX8XQsZKQfsp50xwXT4YL2kHjI+xmvmphBMRCd08T0nGuykLv5SwLZvV72Bg6+yCwm9uXwtFvTagJxbGXmSC01rGfmJ0LAwJP7q0i7uCV+37CsApNWNKuXC7J+TMLli3qP972axcqCm+qEG/g4RpBdWEI=", "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=1771179107; x=1771783907; darn=gcc.gnu.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=p2r/Q4P0bPIZe3Ct0sB0ldg/BbVWXLCJH+UeC2iugWY=;\n b=WwbD3srFh2/hkIRm39HTqM67JYh9nfV9GEs5x/iU4LWrpdnU2wjoHzlayRp5y2qJqe\n SfMIs6+quXWLLbVo+GMB1KFOghuvb0KKeIGOsX9Ev2gAarSJfjarLafug+UIL9aZqk1l\n /M4OaGfu+p1Ve4j64NLazm2pU/Q2vGN/od5Erx4Q8GlaWXW2qoDf+uYccw3hOZN5+Hwr\n 3vFYRrE4gfgIa1THpOlDq0epkm5bAeXYa8USsQFH2Tcgc3ISB6vnyk7D9gTXZKcjHV9F\n KcR0BcdTv+62BsbOD6RWMAH0c+Ep2pmFVhkgOrxzdEByNIHPqukUYV5E0Bar5m8dacfQ\n NGBQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1771179107; x=1771783907;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=p2r/Q4P0bPIZe3Ct0sB0ldg/BbVWXLCJH+UeC2iugWY=;\n b=IlBpEqehYoxjO4WT/+X0ZH81R5bTZNRmO5spPNi07CsVlN9SS9N1RBBNZ+MTD5ZzJd\n axV2Os7JydbmhJnchskjIJy7M7RwT+JyT9HUvi1wZrM/1UaWNJBGrX9JqQ9WnxwYmdWZ\n Lup0BBHtoY39V2zEcKENbNBN1HApvH6aj1GmSjW3774RfO3x6B3M4cthPnsUp55FatQk\n HbW1fh5wgL6T/yJZiQoTXRUCZ4BMMLGffkE1yfz7mkkZ1MA0UW/rKmySGCHWMG89pbEZ\n a6kz0l6rfQ7ZjReOZOpyDqyQEjCLnYkPKS7yehYcMQdAT/gKMhH+xwMD12oFKdqPKJj6\n NcMQ==", "X-Gm-Message-State": "AOJu0YxlqE+s9Y/vfvSQoJqmeM2Vj+vYq12XQ7MptRh18n+NXJm7cKpP\n 7KFjhaCtX9VB2FFgMMMrURJ9QzKRwlgGW5kTOALsa106aQTUgfxjArw8laMf8P10", "X-Gm-Gg": "AZuq6aJNn+xA6San3IIazkCCm4KK4GaxHHb4RBvpUctu3X6ZO6WVE9fS+ox3fSp6I/t\n H2m6qZrUfOI8Yu0sec9/38jSVmzy/tJKcWiyGMT3lNtiUoSmYLfqsq/I97yflFvu8rHZa1LSHiN\n JHjS0iPIbj2yBHT9khOhBfylD7yrCtf7v7EbUa7jJ5rgipvkGP1+ehnzMEdKYZNuCu5IEZNXU8s\n cTK5ZgVsIfX21jbYCNg2kGVtrLP3096jxqEoCTAEI56dsZ/tzEGIcoyDJsQaG97mJKht3C9ALHD\n psQ9VtLMnNI0ZsTueBTesexAUeM6I/gZarLXRwfKC9MKGOFCmxO900J4OGctbKMU5uUFnUi9CXG\n 7iMpod1MEL/wzfKNaRwd8S+nhwYQRB6og76JycnRQJBR7IUsMaJfuqrcKgsKgAz+YF1HKWXY8Kc\n 3Rz1znbXVkfnK+C0xMgAc35MiRvsqzw88uTgY=", "X-Received": "by 2002:a05:600c:458a:b0:483:6f37:1b33 with SMTP id\n 5b1f17b1804b1-48373a58babmr124203765e9.30.1771179106698;\n Sun, 15 Feb 2026 10:11:46 -0800 (PST)", "From": "Gonzalosilvalde <gonzalo.silvalde@gmail.com>", "To": "gcc-patches@gcc.gnu.org", "Cc": "fortran@gcc.gnu.org,\n\tGonzalosilvalde <gonzalo.silvalde@gmail.com>", "Subject": "[PATCH] Fortran: Fix diagnostic for ambiguous pointer function\n assignment [PR80012]", "Date": "Sun, 15 Feb 2026 19:10:52 +0100", "Message-ID": "<20260215181052.741693-1-gonzalo.silvalde@gmail.com>", "X-Mailer": "git-send-email 2.47.3", "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---\n gcc/fortran/symbol.cc | 19 ++++++++++++-------\n gcc/testsuite/gfortran.dg/pr80012.f90 | 14 ++++++++++++++\n 2 files changed, 26 insertions(+), 7 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..f4a73b165d1 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@@ -1888,13 +1889,17 @@ gfc_add_procedure (symbol_attribute *attr, procedure_type t,\n {\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+\t{\n+\tauto_diagnostic_group d;\n+\tgfc_error (\"%s procedure at %L is already declared as %s procedure\",\n+\t\t gfc_code2string (procedures, t), where,\n+\t\t gfc_code2string (procedures, attr->proc));\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 else\n \tgfc_error (\"%s procedure at %L is already declared as %s \"\n \t\t \"procedure\", gfc_code2string (procedures, t), where,\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": [] }