https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108453
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gcc dot gnu.org
--- Comment #2 from anlauf at gcc dot gnu.org ---
Patch:
diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc
index 5e933c12931..f9393f189e0 100644
--- a/gcc/fortran/match.cc
+++ b/gcc/fortran/match.cc
@@ -5345,6 +5345,15 @@ gfc_match_common (void)
goto cleanup;
}
+ /* F2018:C8121: A variable-name shall not be a name made accessible
+ by use association. */
+ if (sym->attr.use_assoc)
+ {
+ gfc_error ("Symbol %qs at %C is USE associated from module %qs "
+ "and cannot occur in COMMON", sym->name, sym->module);
+ goto cleanup;
+ }
+
/* Deal with an optional array specification after the
symbol name. */
m = gfc_match_array_spec (&as, true, true);