The following code causes the compiler to produce a message about an ambiguous reference and then to crash with a segmentation fault (this is on Windows 7, both MinGW and Cygwin)": module quaternion_def_basic implicit none type quaternion !type(complex) :: c(2) complex :: c(2) end type quaternion end module quaternion_def_basic module quaternion_def use quaternion_def_basic, only: T => quaternion end module quaternion_def module octonion_def use quaternion_def, T2 => T implicit none !private :: T2 type T type(T2) :: c(2) end type T end module octonion_def module sedenion_def use octonion_def, T2 => T implicit none !private :: T2 type T type(T2) :: c(2) end type T end module sedenion_def When I bring the "private" statements back, all is well.
Confirmed from 4.8 up to trunk (6.0). Note that the code compiles if the line !private :: T2 is uncommented in the module octonion_def.
This appears to be fixed on 6 and 7. Please check.
> This appears to be fixed on 6 and 7. Please check. I still get pr67757_db_1.f90:27:8: use octonion_def, T2 => T 1 Error: Name 't2' at (1) is an ambiguous reference to 't' from module 'octonion_def' pr67757_db_1.f90:27:8: use octonion_def, T2 => T 1 Error: Name 't2' at (1) is an ambiguous reference to 't' from module 'octonion_def' pr67757_db_1.f90:34:16: type(T2) :: c(2) 1 Error: Type name 't2' at (1) is ambiguous with trunk, and pr67757.f90:27:8: use octonion_def, T2 => T 1 Error: Name 't2' at (1) is an ambiguous reference to 't' from module 'octonion_def' pr67757.f90:27:8: use octonion_def, T2 => T 1 Error: Name 't2' at (1) is an ambiguous reference to 't' from module 'octonion_def' (null):0: confused by earlier errors, bailing out with 5.4.0 and 6.1.0.
This no longer ICEs, probably after r238822 . Closing as fixed.