- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I got an catastrophic error: **Internal compiler error: internal abort** on the example module below:
module error
implicit none
type :: mytype
contains
procedure, pass, public :: mylogical
end type
contains
subroutine mysub(this)
type(mytype), intent(inout) :: this
logical mylogical
mylogical = .true.
if(.not.this%mylogical) write(*,*) 'blah'
end subroutine mysub
function mylogical(this) result(res)
class(mytype), intent(in) :: this
logical :: res
res=.true.
end function
end module error
Version:
ifort --version
ifort (IFORT) 19.0.4.243 20190416
Copyright (C) 1985-2019 Intel Corporation. All rights reserved.
However, the above code compiles without error upon removing ".not." in the routine mysub.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As Ron suggests, referencing a function without an argument list (even if empty) is not allowed by the language.
R1520 function-reference is procedure-designator ( [ actual-arg-spec-list ] )
As you can see from the syntax rule, the parentheses are required.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With compiler 19.1.x your example gets a error message and does not crash the compiler:
ifort -c -V repro.f90
Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.1.0.166 Build 20191121
Copyright (C) 1985-2019 Intel Corporation. All rights reserved.
Intel(R) Fortran 19.1-1555
repro.f90(15): error #8497: Illegal use of a procedure name in an expression, possibly a function call missing parenthesis. [MYLOGICAL]
if(.not.this%mylogical) write(*,*) 'blah'
-------------^
If I change your syntax to:
if(.not.this%mylogical()) write(*,*) 'blah'
!... note the parens ^^ here that the compiler wants
I can check The Standard to see if this is correct if I get a chance in a couple of days - it's low priority since we have a workaround ( change the syntax, use a 19.1 or newer compiler). I recommend keeping up to date with the compilers. 19.1 has a lot more Fortran Standard implemented, bug fixes, and warning/error messages in syntax checking.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As Ron suggests, referencing a function without an argument list (even if empty) is not allowed by the language.
R1520 function-reference is procedure-designator ( [ actual-arg-spec-list ] )
As you can see from the syntax rule, the parentheses are required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your fast answers. I was fully aware of the missing parenthesis, though I should have mentioned it in the post.
I just wanted to report the internal compiler error, as I thought would be something you guys would be interested in, although - as Ronald_G_Intel said - it is low priority. I do not have the newer compiler versions jet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try
if(.not.this%mylogical()) write(*,*) 'blah'
That is, add '()' after the function name.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page