[Bug fortran/126558] New: -Wundefined-vars with ASSOCIATE

"tkoenig at gcc dot gnu.org via Gcc-bugs" <[email protected]> Sat, 01 Aug 2026 07:12:29 +0000
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126558

            Bug ID: 126558
           Summary: -Wundefined-vars with ASSOCIATE
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org
  Target Milestone: ---

program memain
  integer :: x
  associate (y => x)
    y = 17
  end associate
  print *, x
end program memain

yields

assoc.f90:6:10:

    6 |   print *, x
      |          1
Warnung: Undefined variable »x« used at (1) [-Wundefined-vars]