[Bug fortran/71565] INTENT(IN) polymorphic argument with pointer components - reject valid code
pault at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Oct 15 06:11:52 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71565
--- Comment #7 from Paul Thomas <pault at gcc dot gnu.org> ---
> Thus I think we need to distinguish whether there is an associate name or
> not,
> and in turn suppress the failing check.
Hi Harald,
On a second look, you are correct about the error because it is not 'var' that
is assigned to but, rather, what is pointed to by var%i.
The 'var' in each CLASS IS and TYPE IS is an artificial pointer entity that is
pointer associated to the variable 'var'. The 'target' is a variable expression
for 'var'. Thus the fix is to suppress the error by identifying that the lhs is
a pointer in an assignment.
Good luck. I am away for a week but will take a peek at this immediately on my
return.
Paul
More information about the Gcc-bugs
mailing list