From: Jose E. Marchesi Date: Sat, 27 Dec 2025 10:22:37 +0000 (+0100) Subject: a68: remove redefined_keyword check and add test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05b35491d31dfe0fd86440f4219000164ad4a701;p=thirdparty%2Fgcc.git a68: remove redefined_keyword check and add test This commit removes a spurious call to detect_redefined_keyword that would emit confusing error messages. Signed-off-by: Jose E. Marchesi gcc/algol68/ChangeLog * a68-parser-extract.cc (a68_extract_indicants): Do not detect_redefined_keyword for accessed modules. gcc/testsuite/ChangeLog * algol68/compile/modules/program-error-multiple-delaration-module-1.a68: New test. --- diff --git a/gcc/algol68/a68-parser-extract.cc b/gcc/algol68/a68-parser-extract.cc index da14e1a2cae..42602daad33 100644 --- a/gcc/algol68/a68-parser-extract.cc +++ b/gcc/algol68/a68-parser-extract.cc @@ -345,7 +345,6 @@ a68_extract_indicants (NODE_T *p) FORWARD (q); if (q != NO_NODE) { - detect_redefined_keyword (q, MODULE_DECLARATION); if (IS (q, BOLD_TAG)) { extract_revelation (q, false /* is_public */); diff --git a/gcc/testsuite/algol68/compile/modules/program-error-multiple-delaration-module-1.a68 b/gcc/testsuite/algol68/compile/modules/program-error-multiple-delaration-module-1.a68 new file mode 100644 index 00000000000..39ce7fe2b0f --- /dev/null +++ b/gcc/testsuite/algol68/compile/modules/program-error-multiple-delaration-module-1.a68 @@ -0,0 +1,8 @@ +{ dg-modules "module10 module11 module12" } + +access Module10, + Module11, + Module11 { dg-error "multiple declaration.*bar" } +begin assert (foo = 10); + assert (bar = 20) +end