- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Parameterised derived types with kind parameters which have default values set to parameters are not working as I expect in Intel Visual Fortran Compiler XE 15.0.2.179. Is this a bug or are my expectations wrong?
The following code shows the issue:
module imp_module implicit none private integer, parameter :: n = 5 type, public :: dt(k) integer, kind :: k = n integer, dimension(k) :: x end type dt end module imp_module program imp_prog use imp_module type(dt) :: x print *,x end program imp_prog
Compiling the code gives:
Deleting intermediate files and output files for project 'imp', configuration 'Debug|Win32'. Compiling with Intel(R) Visual Fortran Compiler XE 15.0.2.179 [IA-32]... ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc120.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qvc12 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\\bin" "C:\Users\Nicholas\Documents\imp_bug\imp_module.f90" ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc120.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qvc12 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\\bin" "C:\Users\Nicholas\Documents\imp_bug\imp_prog.f90" C:\Users\Nicholas\Documents\imp_bug\imp_prog.f90(5): error #6683: A kind type parameter must be a compile-time constant.type(dt) :: x ^ compilation aborted for C:\Users\Nicholas\Documents\imp_bug\imp_prog.f90 (code 1) imp - 2 error(s), 0 warning(s)
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regarding Ian's examples in post 19, I tried them with the current in-house compiler. The first one gets a compile-time error, but not a correct one. The second still has the same bad behavior. The third now gives no standards warnings. I have reported the first two to the developers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem Nicholas described in the original post has been fixed for a release later this year. The issues from Ian's post #19 are still being investigated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issues Ian raised in post 19 are being fixed for the 16.0 release.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »