http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43366
--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-03
21:28:10 UTC ---
(In reply to comment #4)
> Here is a simple patch for getting rid of the error message:
The patch is not quite right. The LHS must be allocatable and it must not be
coindexed nor a coarray - otherwise, an intrinsic allocate is not allowed.
Cf. "7.2.1.2 Intrinsic assignment statement": "(1) if the variable is
polymorphic it shall be allocatable and not a coarray," + quote in comment 0.
Thus, you need something like:
if (lhs->ts.type == BT_CLASS)
{
if (gfc_expr_attr(e).allocatable") && !gfc_is_coindexed(e)
&& !gfc_expr_attr(e).codimension)
{
if (gfc_notify_std(F2008 ...) == FAILURE)
return false;
}
else
{
gfc_error ();
return false;
}
}