-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Flang] Incorrect diagnostic on intrinsic ASSOCIATED
when the TARGET
argument is unlimited polymorphic
#125774
Comments
@llvm/issue-subscribers-flang-frontend Author: Daniel Chen (DanielCChen)
Consider the following code
```
type :: bType
integer*4 :: i1
end type
end
./t.f:13:15: error: Arguments of ASSOCIATED() must be a pointer and an optional valid target
|
I think that this is a bug. 7.3.3 has "Even though an unlimited polymorphic entity is not considered to have a declared type, it is type compatible with all entities.", and the text defining |
I think that only the last two calls should be flagged as errors. I might emit a portability warning for the first three cases. |
As I read the standard, an unlimited polymorphic pointer or target should be viewed as compatible with any data target or data pointer when used in the two-argument form of the intrinsic function ASSOCIATED(). Fixes llvm#125774.
… as error (#125890) As I read the standard, an unlimited polymorphic pointer or target should be viewed as compatible with any data target or data pointer when used in the two-argument form of the intrinsic function ASSOCIATED(). Fixes llvm/llvm-project#125774.
…lvm#125890) As I read the standard, an unlimited polymorphic pointer or target should be viewed as compatible with any data target or data pointer when used in the two-argument form of the intrinsic function ASSOCIATED(). Fixes llvm#125774.
Consider the following code
Flang currently issues an error as:
The code seems valid as the standard requires the type of
TARGET
to be compatible withPOINTER
argument.Unlimited polymorphic entity is type compatible with all entities.
All ifort, gfortran and XLF compile the code successfully.
The text was updated successfully, but these errors were encountered: