+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
/* 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));
+2009-08-14 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/41070
+ * gfortran.dg/structure_constructor_10.f90: New.
+
2009-08-14 Olatunji Ruwase <tjruwase@google.com>
* gcc.dg/pragma-re-1.c: Supported on all platforms.
--- /dev/null
+! { dg-do compile }
+!
+! PR 41070: [4.5 Regression] Error: Components of structure constructor '' at (1) are PRIVATE
+!
+! Contributed by Michael Richmond <michael.a.richmond@nasa.gov>
+
+MODULE cdf_aux_mod
+IMPLICIT NONE
+
+TYPE :: one_parameter
+ CHARACTER (8) :: name
+END TYPE one_parameter
+
+TYPE :: the_distribution
+ CHARACTER (8) :: name
+END TYPE the_distribution
+
+TYPE (the_distribution), PARAMETER :: the_beta = the_distribution('cdf_beta')
+END MODULE cdf_aux_mod
+
+SUBROUTINE cdf_beta()
+ USE cdf_aux_mod
+ IMPLICIT NONE
+ CALL check_complements(the_beta%name)
+END SUBROUTINE cdf_beta
+
+! { dg-final { cleanup-modules "cdf_aux_mod" } }
+