[Bug fortran/58177] Incorrect warning message about unused PRIVATE module variable

2013-08-18 Thread tkoenig at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58177

Thomas Koenig  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #3 from Thomas Koenig  ---
Closing, then.

Do keep these bug reports, coming, though :-)


[Bug fortran/58177] Incorrect warning message about unused PRIVATE module variable

2013-08-18 Thread abensonca at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58177

--- Comment #2 from Andrew Benson  ---
You're absolutely correct -  my mistake!


[Bug fortran/58177] Incorrect warning message about unused PRIVATE module variable

2013-08-18 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58177

janus at gcc dot gnu.org changed:

   What|Removed |Added

 CC||janus at gcc dot gnu.org

--- Comment #1 from janus at gcc dot gnu.org ---
(In reply to Andrew Benson from comment #0)
> module a
>   logical :: m
> end module a
> module b
>   logical, private :: m
> contains
>   subroutine bb()
> use a
> m=.true.
>   end subroutine bb
> end module b
> 
> [...]  
> 
>   logical, private :: m 
> 
>1
> Warning: Unused PRIVATE module variable 'm' declared at (1)

AFAICS the warning is correct: Your USE statement imports all public symbols
from module a, including 'm'. Therefore the 'm' from 'a' is used and not the
'm' from 'b'. The same is achieved by explicitly importing 'm' via

use a, only: m

which gives the same warning (correctly, I would say).

Or am I missing something here?