[flang-commits] [flang] [flang] Adding a new exception that was noticed to be intentionally in the code. (PR #182891)
via flang-commits
flang-commits at lists.llvm.org
Thu Feb 26 09:12:12 PST 2026
https://github.com/kwyatt-ext updated https://github.com/llvm/llvm-project/pull/182891
>From 556daa399fc0840bb96c2178b3212b6507295f6d Mon Sep 17 00:00:00 2001
From: kwyatt-ext <kwyatt.external at hpe.com>
Date: Mon, 23 Feb 2026 10:58:39 -0600
Subject: [PATCH] [flang] Adding a new exception that was noticed to be
intentionally in the code.
The flang compiler intentionally issues a warning on duplicate prefix-specs for procedures. This is not consistent with the standard which says "shall contain at most one of each". Other tested compilers correctly issue an error.
It is safe to leave this as a warning. It can be turned into an error condition by using the "-Werror" flag.
However, it should be noted in the Extensions document, similar to the mention of the SAVE attribute.
---
flang/docs/Extensions.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/flang/docs/Extensions.md b/flang/docs/Extensions.md
index 79e6213f7f3c9..db4bee145f5dc 100644
--- a/flang/docs/Extensions.md
+++ b/flang/docs/Extensions.md
@@ -483,6 +483,9 @@ end
are to the same value. Distinct initializations remain errors.
* A pointer component that has no default initialization or explicit value
in a structure constructor is defaulted to `NULL()`.
+* Multiple specifications of a prefix-spec on the same procedure are allowed,
+ with a warning. C1552 (F2023) specifies that at most one of each shall be
+ present.
### Extensions supported when enabled by options
More information about the flang-commits
mailing list