The initialization in following test case should be diagnosed as an error:
$ cat nocomp7.f90
module nocomp7
implicit none
type bad_t
real, allocatable :: x(:)
end type
! The following is illegal!
type (bad_t) :: bad = bad_t ( (/ 1., 3., 5., 7., 9. /) )
end module
$
$ gfortran --version
GNU Fortran (GCC) 4.3.0 20071005 (experimental) [trunk revision 127783]
Copyright (C) 2007 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
$
$ gfortran --pedantic -c nocomp7.f90
$
--
Summary: Diagnose illegal initialization of derived type
containing allocatable component
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: w6ws at earthlink dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34402