Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ifort 16 BUG: setting an array value returned from a function #15

Open
victorsndvg opened this issue Apr 12, 2016 · 0 comments
Open

Ifort 16 BUG: setting an array value returned from a function #15

victorsndvg opened this issue Apr 12, 2016 · 0 comments
Labels

Comments

@victorsndvg
Copy link
Owner

The following code snippet reproduces the error:

Program test_up_dummy_arg_function_result

call print_int_array(get_int_array())                       ! <- It works!
call print_unlimited_polymorphic_array( (get_int_array()) ) ! <- It works!
call print_unlimited_polymorphic_array(  get_int_array()  ) ! <- SIGSEGV

contains
    function get_int_array() result(array)
        integer,allocatable :: array(:)
        allocate(array(5))
        array = 5
    end function get_int_array

    subroutine print_int_array(array)
        integer, intent(in) :: array(:)
        print*, array
    end subroutine print_int_array

    subroutine print_unlimited_polymorphic_array(array)
        class(*), intent(in) :: array(:)
        select type(array)
            type is (integer)
                print*, array
        end select
    end subroutine print_unlimited_polymorphic_array
end program 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant