Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
9 Views

Error with internal subprogram in impure elemental routine

Greetings,

i got an error with the impure feature. It states: error #7949: All internal subprograms in a pure subprogram shall be pure.
It does not matter, wether the routines are functions or subroutines.

module test_mod

contains

  impure elemental subroutine foo()

    contains

    function bar()
      integer :: bar
      bar = 1
    end function

  end subroutine

end module

I wanted to pack some output statements in an internal subroutine to avoid code duplication.
Would this approach be valid?

 

Wolf

0 Kudos
3 Replies
Highlighted
9 Views

This is a compiler bug. I will report it to the developers - thanks. Issue ID DPD200408689.

0 Kudos
Highlighted
9 Views

This has been fixed for a future release. (At the moment, not planned for 17.0 but I have asked that the fix be put there.)

0 Kudos
Highlighted
9 Views

The fix should appear in Update 1 to 17.0 (Parallel Studio XE 2017), probably October or so.

0 Kudos