[COMMITTED] a68: consolidate hidden-declarations diagnostics

Jose E. Marchesi jemarch@gnu.org
Sat Nov 1 10:53:57 GMT 2025


---
 gcc/algol68/a68-parser-taxes.cc | 28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/gcc/algol68/a68-parser-taxes.cc b/gcc/algol68/a68-parser-taxes.cc
index e3ff4e4653c..9d38c91138c 100644
--- a/gcc/algol68/a68-parser-taxes.cc
+++ b/gcc/algol68/a68-parser-taxes.cc
@@ -667,22 +667,18 @@ already_declared_hidden (NODE_T *n, int a)
   TAG_T *s = a68_find_tag_global (PREVIOUS (TABLE (n)), a, NSYMBOL (n));
   if (s != NO_TAG)
     {
-      if (TAG_TABLE (s) == A68_STANDENV)
-	{
-	  a68_warning (n, OPT_Whidden_declarations,
-		       "declaration hides prelude declaration of M S",
-		       MOID (s), NSYMBOL (n));
-	}
-      else
-	{
-	  if (a68_warning (n, OPT_Whidden_declarations,
-			   "declaration hides a declaration of S with larger reach",
-			   NSYMBOL (n)))
-	    {
-	      a68_inform (NO_NODE,
-			  "previous hidden declaration of S declared here",
-			  NSYMBOL (n));
-	    }
+      if (a68_warning (n, OPT_Whidden_declarations,
+		       "Z hides a declaration with larger reach",
+		       NSYMBOL (n)))
+	{
+	  if (TAG_TABLE (s) == A68_STANDENV)
+	    a68_inform (NO_NODE,
+			"M Z defined in the standard prelude",
+			MOID (s), NSYMBOL (NODE (s)));
+	  else
+	    a68_inform (NODE (s),
+			"previous hidden declaration of S declared here",
+			NSYMBOL (n));
 	}
     }
 }
-- 
2.30.2



More information about the Algol68 mailing list