I intend to commit the fix to the error message using the patch below
within the next 24h unless there are objections or better suggestions.

The unchanged part of the error message is already covered by
gcc/testsuite/gfortran.dg/unlimited_polymorphic_2.f03 and does
not need to be adapted.

Thanks,
Harald


Fortran - improve wording of error message

gcc/fortran/ChangeLog:

        PR fortran/56985
        * resolve.c (resolve_common_vars): Fix grammar and improve wording
        of error message rejecting an unlimited polymorphic in COMMON.

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index f641d0d4dae..8e5ed1c032c 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -979,7 +979,7 @@ resolve_common_vars (gfc_common_head *common_block, bool named_common)
 	}

       if (UNLIMITED_POLY (csym))
-	gfc_error_now ("%qs in cannot appear in COMMON at %L "
+	gfc_error_now ("%qs at %L cannot appear in COMMON "
 		       "[F2008:C5100]", csym->name, &csym->declared_at);

       if (csym->ts.type != BT_DERIVED)

Reply via email to