Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Error message about multiple PRIVATE statements not being allowed

$
0
0

I am experimenting with a generic programming technique - via rename clauses, see the code below - and I get an error message about multiple PRIVATE statements being used. I do not quite understand why because the two statements are in separate modules:

module quaternion_def_basic
    implicit none

    type quaternion
        !type(complex) :: c(2)
        complex :: c(2)
    end type quaternion
end module quaternion_def_basic

module quaternion_def
    use quaternion_def_basic, only: T => quaternion
end module quaternion_def

module octonion_def
    use quaternion_def, T2 => T

    implicit none

    private :: T2

    type T
        type(T2) :: c(2)
    end type T
end module octonion_def

module sedenion_def
    use octonion_def, T2 => T

    implicit none

    private :: T2

    type T
        type(T2) :: c(2)
    end type T
end module sedenion_def

If I comment out the PRIVATE statement in the sedenion_def module, the code is accepted. Can anyone point out whether this is a genuine programming error or something that is wrong in the compiler. FYI: gfortran does accept the code.

I am using Intel Fortran 2015 for this.


Viewing all articles
Browse latest Browse all 5691

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>