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

--- Comment #16 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-07-12 
14:44:11 UTC ---
(In reply to comment #14)
> allocate(character(len=length)::string)
> 
> This is not yet accepted by gfortran. Is there any other way to allocate
> "string" without a primitive like string=repeat(" ",10)?

  Error: Variable 'length' cannot appear in the expression at (1)

That comes from the specification expression check. The check is called via
  resolve_types -> resolve_charlen -> resolve_index_expr ->
gfc_specification_expr

Thus, one needs to somehow distinguish length specifications in the ALLOCATE
from those in a type-declaration statement; I think one needs to modify both
resolve_index_expr (not calling gfc_specification_expr) and resolve_charlen
(not setting specification_expr).

Reply via email to