https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105594
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2022-05-13
CC| |kargl at gcc dot gnu.org
Priority|P3 |P4
--- Comment #1 from kargl at gcc dot gnu.org ---
This patch suppresses the warning and allows the code to compile.
diff --git a/gcc/fortran/module.cc b/gcc/fortran/module.cc
index 85aa153bd77..98c056ac7e5 100644
--- a/gcc/fortran/module.cc
+++ b/gcc/fortran/module.cc
@@ -7261,7 +7261,7 @@ gfc_use_module (gfc_use_list *module)
only_flag = module->only_flag;
current_intmod = INTMOD_NONE;
- if (!only_flag)
+ if (!only_flag && gfc_state_stack->state != COMP_SUBMODULE)
gfc_warning_now (OPT_Wuse_without_only,
"USE statement at %C has no ONLY qualifier");