Bug 102582 - allocate treats all variables as type CHARACTER after use of CHARACTER(LEN=NNN)::
Summary: allocate treats all variables as type CHARACTER after use of CHARACTER(LEN=NN...
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 10.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-04 00:59 UTC by urbanjost
Modified: 2021-10-05 19:58 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
example of ALLOCATE(3f) statement that fails (730 bytes, text/plain)
2021-10-04 00:59 UTC, urbanjost
Details

Note You need to log in before you can comment on or make changes to this bug.
Description urbanjost 2021-10-04 00:59:10 UTC
Created attachment 51544 [details]
example of ALLOCATE(3f) statement that fails

After an allocate of the form "ALLOCATE(CHARACTER(LEN=NNN) :: A(10),B(10),C(10))"
all variables after "A" are treated as CHARACTER even though declared to be other types.
Comment 1 urbanjost 2021-10-04 01:34:28 UTC
Never mind. It looks like

C934 (R927) If type-spec appears, it shall specify a type with which each allocate-object is type compatible.

it should do that, and nvfortran and ifort are the ones doing it incorrrectly.
If that does mean gfortran is correct, feel free to to close this; but I would like someone to concur before I close this.

It worked as I expected with two other compilers :>
Comment 2 anlauf 2021-10-05 19:58:48 UTC
Thanks for confirming that other compilers may have bugs!  Closing as per request.