https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30438
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Thomas Koenig <[email protected]>: https://gcc.gnu.org/g:93c0eb70fe729f656dbfff811a8ca45fc9607361 commit r17-1546-g93c0eb70fe729f656dbfff811a8ca45fc9607361 Author: Thomas Koenig <[email protected]> Date: Sun Jun 14 09:33:41 2026 +0200 Add a few cases where -Wwarn-unused-but-set-variable should not warn. When variables are use-associated, volatile or asynchronous, reference or definition may not be visible in the local namespace. Thus, they need to be excluded from unused vs set warnings. gcc/fortran/ChangeLog: PR fortran/30438 * resolve.cc (find_unused_vs_set): Exclude variables from cwarnings if use_assoc, volatile_ or asynchronous are set. gcc/testsuite/ChangeLog: PR fortran/30438 * gfortran.dg/warn_unused_but_set_variable_3.f90: New test.
