Fortran: Fix regression due to r16-669 [PR124161]

2026-03-19  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
	PR fortran/124161
	* resolve.cc (resolve_symbol): Do not apply the default
	initializer if the symbol is used in a submodule.

gcc/testsuite/
	PR fortran/124161
	* gfortran.dg/pr124161.f90: New test.

(cherry picked from commit 240886adb8ac1a381a9dfd67f94755357c42c790)
2 files changed