- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
The following example reproduces a regression in the oneAPI 2025.2 Fortran compiler that I encountered in our production code.
module m1
character(:), pointer, private :: string => null()
contains
function get()
class(*), pointer :: get
if (.not.associated(string)) allocate(string, source='foo')
get => string
end function
subroutine set(arg)
class(*), intent(in) :: arg
select type (arg)
type is (character(*))
print *, 'set received string "', arg, '"'
if (arg /= 'foo') stop 'ERROR!'
end select
end subroutine
end module
use m1
select type (s => get())
type is (character(*))
print *, 'passing string "', s, '" to set'
call set(s)
end select
endIt produces the incorrect result
$ ifx intel-20250709.f90
$ ./a.out
passing string "foo" to set
set received string ""
ERROR!The expected output (from 2025.1, for instance) is of course
passing string "foo" to set
set received string "foo"
Enlace copiado
3 Respuestas
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
A workaround in the main program is to assign S to a local allocatable character variable and pass it instead:
use m1
character(:), allocatable :: ss
select type (s => get())
type is (character(*))
print *, 'passing string "', s, '" to set'
ss = s
call set(ss)
end select
end
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Ping to someone on the Intel team. This regression still exists in 2025.3.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Unfortunately, it is still in the latest engineering build. I am escalating to fix it (CMPLRLLVM-74899).
Responder
Opciones de temas
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla