- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I found a small bug with both ifort and ifx compilers when trying to allocate a logical array by negating on a source array. Here a minimal reproducer:
logical, allocatable :: mask(:), nmask(:)
allocate( mask(5) , source = .false. )
allocate( nmask(5), source = .not.mask(:))
end
This prompts:
error #5082: Syntax error, found '.' when expecting one of: ( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> ...
allocate( nmask(5), source = .not.mask(:))
Thanks,
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And this compiles OK so I would agree there has to be a problem here. The new front end needs a tweak...
allocate( nmask(5), source = ( .not.mask(:) ) )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Presumably
nmask = .not. mask
still works???!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes indeed that work ok I will note that these variants give different errors. It is just not parsing the .not. correctly
allocate( nmask(5), source = .not.mask(:)) ! error #5082
allocate( nmask(5), source = .not.mask) ! errors #6764 and #8155
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is an interesting case. I am opening a bug report. Thanks for finding this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
bug ID is CMPLRLLVM-54326
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue was fixed, and the fix is available in ifx 2025.
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