- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
today I stumbled over an issue in the debugger extension into VS 2015 (update 1). I have a dereived type with again derived type sub-component which is allocatable. In a module I allocate this sub-component. The debugger shows a 'syntax error' in hover over. However, I'm not sure whether the code is conforming to standard.
program DerivedTypeAllocatableDebugger use mod_test use mod_allocate implicit none ! Variables! integer, parameter :: n = 10 ! ---------------------------------------------------------------------------------- ! Body of DerivedTypeAllocatableDebugger write(*,*) '*** DerivedTypeAllocatableDebugger ***' call sub_alloc(n,test_type) end program DerivedTypeAllocatableDebugger module mod_test implicit none type :: subdummy1 integer :: number character(len=80) :: name='' end type subdummy1 ! type :: subdummy2 integer :: number character(len=80) :: name='' character(len=2 ) :: site='' end type subdummy2 type :: dummy type(subdummy1),dimension(: ),allocatable :: planes type(subdummy2),dimension(:,:),allocatable :: lines end type dummy type(dummy) :: test_type end module mod_test module mod_allocate implicit none private public :: sub_alloc contains ! -------------------------------------------------------- subroutine sub_alloc(n,test_type) use mod_test, only : dummy implicit none ! parameter integer :: n type(dummy) :: test_type ! locals character(len=4) :: tdummy integer :: i ! ----------------------------------- allocate(test_type%planes(n)) do i = 1, n write(tdummy,'(i0.4)') i test_type%planes(i)%name = tdummy test_type%planes(i)%number = i end do return end subroutine sub_alloc ! -------------------------------------------------------- end module mod_allocate
The error looks like:
Any hint what is wrong?
EDIT: VS 2015 Update 1 + PSXE 2016 Update 1
Best regards Johannes
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't see anything wrong with your code and will send this along to the developers. Thanks. Issue ID is DPD200379544
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am told that the fix for this will be in Parallel Studio XE 2016 Update 2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
PSXE16 update 2 solved the issue above, but unfortunately my real code has one level of complexity more and there the debugger shows the same syntax error. I modified the reproducer code above so that one level of derived type is added (VS 2015 Update 1 + PSXE 2016 Update 2):
program DerivedTypeAllocatableDebugger use mod_test use mod_allocate implicit none ! Variables! integer, parameter :: n = 10 ! ---------------------------------------------------------------------------------- ! Body of DerivedTypeAllocatableDebugger write(*,*) '*** DerivedTypeAllocatableDebugger ***' call sub_alloc(n,test_supertype%dummy) write(*,*) test_supertype%dummy%planes continue end program DerivedTypeAllocatableDebugger module mod_test implicit none type :: subdummy1 integer :: number character(len=80) :: name='' end type subdummy1 ! type :: subdummy2 integer :: number character(len=80) :: name='' character(len=2 ) :: site='' end type subdummy2 type :: dummy type(subdummy1),dimension(: ),allocatable :: planes type(subdummy2),dimension(:,:),allocatable :: lines end type dummy type :: superdummy type(dummy) :: dummy integer :: i_dummy end type type(dummy) :: test_type type(superdummy) :: test_supertype end module mod_test module mod_allocate implicit none private public :: sub_alloc contains ! -------------------------------------------------------- subroutine sub_alloc(n,test_type) use mod_test, only : dummy implicit none ! parameter integer :: n type(dummy) :: test_type ! locals character(len=4) :: tdummy integer :: i ! ----------------------------------- allocate(test_type%planes(n)) do i = 1, n write(tdummy,'(i0.4)') i test_type%planes(i)%name = tdummy test_type%planes(i)%number = i end do return end subroutine sub_alloc ! -------------------------------------------------------- end module mod_allocate
The screenshot is
An extension of the debugger for this case would be fine.
Best, regards Johannes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not seeing this problem in 16.0.2. I note that the source, as you present it, has the program before the modules. If you hadn't recompiled the source earlier, the program would get the old modules.
Please move the program to the end, rebuild, and try again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
thanks for the information. Actually the program and the two modules are in three different files. Nevertheless, I cleaned the solution, built it and checked again. The debbuger shows me still a 'syntax error' for 'test_supertype%dummy' planes and lines sub-components in hover over and in watch window. The shell output is as expected.
The original example is OK and wasn't in 16.0.1, so I assume the 16.0.2 integration into VS2015 sp 1 has been OK. I attached the whole solution as zip. Maybe I do something wrong in there.
Best regards, Johannes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok. It works in 32-bit but not 64-bit. Strange. I will let the developers know. New issue ID is DPD200382235.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This last will get fixed in Update 3.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I can confirm that 16 update 3 solves the issue (32 and 64 bits). Many thanks to the Intel team.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page