This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/37274] [Regression 4.4 (and 4.3?)] error: type name is ambiguous.
- From: "mikael dot morin at tele2 dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Aug 2008 11:27:08 -0000
- Subject: [Bug fortran/37274] [Regression 4.4 (and 4.3?)] error: type name is ambiguous.
- References: <bug-37274-9410@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from mikael dot morin at tele2 dot fr 2008-08-30 11:27 -------
I think this should be rejected :
module class_vector
implicit none
type vector
end type vector
end module class_vector
module tools_math
implicit none
interface lin_interp
function lin_interp_v()
use class_vector
type(vector ) :: lin_interp_v
end function lin_interp_v
end interface
end module tools_math
module smooth_mesh
use tools_math
implicit none
type(vector ) :: new_pos ! vector shouldn't be available IMHO
end module smooth_mesh
I find this behavior very confusing, inconsistent with the concept of scoping
units.
While I understand that vector should make its way to the tools_math.mod file
for lin_interp_v's type checking, it should be kept local to that function.
I haven't seen it explicitely in the standard though.
Salvatore, as a workaround you can put a private statement in modules
where you "use module" from within a function.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37274