- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I am evaluating the most recent (12.0.0) version of the Intel fortran compiler, and I thought I'd drop a line since I came across what looks like a bug.
Consider the following code. It uses a generic type bound procedure with a keyword (optional) argument.
This code complies fine with the NAG fortran compiler 5.2, but not with the most recent Intel fortran compiler. The latter generates the error message:
test.f90(25): error #6632: Keyword arguments are invalid without an explicit interface.
call t%method(1, c='a')
-------------------^
test.f90(26): error #6632: Keyword arguments are invalid without an explicit interface.
call t%method(1.0, c='b')
---------------------^
compilation aborted for test.f90 (code 1)
Consider the following code. It uses a generic type bound procedure with a keyword (optional) argument.
[fortran]module mod_test
implicit none
type :: mytype
contains
procedure :: method1
procedure :: method2
generic :: method => method1, method2
end type mytype
contains
subroutine method1(self, i, c)
class(mytype) :: self
integer :: i
character, optional :: c
end subroutine method1
subroutine method2(self, f, c)
class(mytype) :: self
real :: f
character, optional :: c
end subroutine method2
end module mod_test
program test
use mod_test
implicit none
type(mytype) :: t
call t%method(1, c='a')
call t%method(1.0, c='b')
end program test[/fortran] This code complies fine with the NAG fortran compiler 5.2, but not with the most recent Intel fortran compiler. The latter generates the error message:
test.f90(25): error #6632: Keyword arguments are invalid without an explicit interface.
call t%method(1, c='a')
-------------------^
test.f90(26): error #6632: Keyword arguments are invalid without an explicit interface.
call t%method(1.0, c='b')
---------------------^
compilation aborted for test.f90 (code 1)
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for letting us know about this. I will report it to the developers. Issue ID is DPD200166645.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This bug has been fixed in our sources - the fix will appear in a future version of the compiler.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page