http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42647

--- Comment #11 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-10-13 
13:21:40 UTC ---
(In reply to comment #10)
> allocate(a1, a1%b1, a1%b1%c1)

This ALLOCATE statement is INVALID! It violates the following:

"An allocate-object [...] shall not depend [...] on the [...] allocation status
[...] of any allocate-object in the same ALLOCATE statement."

(F2008, "6.7.1 ALLOCATE statement" first paragraph after C644.)

Solution: Write it as
  allocate(a1)
  allocate(a1%b1)
  allocate(a1%b1%c1)

The test case still fails: For the DEALLOCATE statement one wrongly gets the
error that the variable is not allocated.

 * * *

Cf. also Janus' patch for this PR (which does not yet fix this DEALLOCATE
issue):
  http://gcc.gnu.org/ml/fortran/2010-10/msg00155.html

Reply via email to