aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorTobias Burnus <burnus@gcc.gnu.org>2010-02-01 22:37:49 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2010-02-01 22:37:49 +0100
commitade20620238fcc16f61e38aa199bde4d9e03952a (patch)
tree077d753f7ff743d2fa38fc8c1ddc2bb4156c1fd4 /gcc/fortran
parent6eeea7a76e7741882185847fd061bb8ff59c4c1e (diff)
downloadgcc-ade20620238fcc16f61e38aa199bde4d9e03952a.zip
gcc-ade20620238fcc16f61e38aa199bde4d9e03952a.tar.gz
gcc-ade20620238fcc16f61e38aa199bde4d9e03952a.tar.bz2
re PR fortran/42922 (Wrongly rejected derived types with default initializers in PURE procedures 2)
2010-02-01 Tobias Burnus <burnus@net-b.de> PR fortran/42922 * decl.c (variable_decl): Allow default initializer in TYPE declarations in PURE functions. 2010-02-01 Tobias Burnus <burnus@net-b.de> PR fortran/42922 * gfortran.dg/pure_initializer_3.f90: News test. From-SVN: r156433
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog10
-rw-r--r--gcc/fortran/decl.c3
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 0271eb9..9e767557 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-01 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/42922
+ * decl.c (variable_decl): Allow default initializer in
+ TYPE declarations in PURE functions.
+
2010-01-31 Janus Weil <janus@gcc.gnu.org>
PR fortran/42888
@@ -12,10 +18,10 @@
2010-01-31 Paul Thomas <pault@gcc.gnu.org>
- PR fortran/38324
+ PR fortran/38324
* expr.c (gfc_get_full_arrayspec_from_expr): New function.
* gfortran.h : Add prototype for above.
- * trans-expr.c (gfc_trans_alloc_subarray_assign): New function.
+ * trans-expr.c (gfc_trans_alloc_subarray_assign): New function.
(gfc_trans_subcomponent_assign): Call new function to replace
the code to deal with allocatable components.
* trans-intrinsic.c (gfc_conv_intrinsic_bound): Call
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 9f65fe4..015d6a4 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1809,7 +1809,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");