aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2009-08-15 00:02:45 +0200
committerJanus Weil <janus@gcc.gnu.org>2009-08-15 00:02:45 +0200
commita2a0778d2d66c0245deef5973390a6a76deca91b (patch)
tree0b7a74ba957418727623baa12c1dc48c190a28f5 /gcc/fortran
parentc54d7dc9ecbe90d0b6d5604cf4edea0906e201c8 (diff)
downloadgcc-a2a0778d2d66c0245deef5973390a6a76deca91b.zip
gcc-a2a0778d2d66c0245deef5973390a6a76deca91b.tar.gz
gcc-a2a0778d2d66c0245deef5973390a6a76deca91b.tar.bz2
re PR fortran/41070 (Error: Components of structure constructor '' at (1) are PRIVATE)
2009-08-14 Janus Weil <janus@gcc.gnu.org> PR fortran/41070 * resolve.c (resolve_structure_cons): Make sure that ts.u.derived is only used if type is BT_DERIVED. 2009-08-14 Janus Weil <janus@gcc.gnu.org> PR fortran/41070 * gfortran.dg/structure_constructor_10.f90: New. From-SVN: r150781
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/resolve.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index f48729e..4f807ea 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2009-08-14 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41070
+ * resolve.c (resolve_structure_cons): Make sure that ts.u.derived is
+ only used if type is BT_DERIVED.
+
2009-08-13 Janus Weil <janus@gcc.gnu.org>
PR fortran/40941
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 9baef62..ff32ae6 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -830,8 +830,8 @@ resolve_structure_cons (gfc_expr *expr)
/* See if the user is trying to invoke a structure constructor for one of
the iso_c_binding derived types. */
- if (expr->ts.u.derived && expr->ts.u.derived->ts.is_iso_c && cons
- && cons->expr != NULL)
+ if (expr->ts.type == BT_DERIVED && expr->ts.u.derived
+ && expr->ts.u.derived->ts.is_iso_c && cons && cons->expr != NULL)
{
gfc_error ("Components of structure constructor '%s' at %L are PRIVATE",
expr->ts.u.derived->name, &(expr->where));