[Bug fortran/42922] Wrongly rejected derived types with default initializers in PURE procedures 2
burnus at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Feb 1 16:38:00 GMT 2010
------- Comment #1 from burnus at gcc dot gnu dot org 2010-02-01 16:37 -------
Thanks for the report! The bug is no regression and indeed the analogue to PR
42008 works also here:
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (revision 156428)
+++ gcc/fortran/decl.c (working copy)
@@ -1809,7 +1815,8 @@ variable_decl (int elem)
m = MATCH_ERROR;
}
- if (current_attr.flavor != FL_PARAMETER && gfc_pure (NULL))
+ if (current_attr.flavor != FL_PARAMETER && gfc_pure (NULL)
+ && gfc_state_stack->state != COMP_DERIVED)
{
gfc_error ("Initialization of variable at %C is not allowed in "
"a PURE procedure");
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |burnus at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Keywords| |rejects-valid
Last reconfirmed|0000-00-00 00:00:00 |2010-02-01 16:37:46
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42922
More information about the Gcc-bugs
mailing list