- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Intel support team
For the following code I obtain an error:
program test
implicit none
type SomeType
real, pointer, contiguous :: x(:) => null()
end type
type(SomeType) :: t
allocate(t%x(10))
call doSomething(t)
write(*,*) t%x
contains
subroutine doSomething(myT)
class(*), intent(in) :: myT
select type(myT)
type is (SomeType)
! not allowed!
! myT%x => null()
! allowed!
myT%x = 7.
! workaround
call assign7(myT%x)
class default
write(*,*) 'error'
call exit(1)
end select
end subroutine
subroutine assign7(x)
real, intent(out) :: x(:)
x = 7
end subroutine
end program test
The error message shown is:
> ifort --version ifort (IFORT) 16.0.3 20160415 > ifort test.f90 test.f90(22): error #6780: A dummy argument with the INTENT(IN) attribute shall not be defined nor become undefined. [MYT] myT%x = 7. ------^ compilation aborted for test.f90 (code 1)
As x is a pointer changing its value should be allowed though. Everything works fine, when "myT" is just declared as "type(SomeType), intent(in)" (without using "class(*)" polymorphism)!
As a workaround it is possible to call a subroutine to modify "myT%x"...
Regards
Melven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reporting the error. It no longer happens with 17.0 compiler which will be released very soon.
Thanks,
Xiaoping Duan
Intel Customer Support
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reporting the error. It no longer happens with 17.0 compiler which will be released very soon.
Thanks,
Xiaoping Duan
Intel Customer Support
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page