The following test case should be diagnosed as an error. This is because the
type definition (e.g, X_t) is private, but the entity defined with it (abc) is
public.
module xyzzy
implicit none
private
type X_t
real :: y
real :: z
end type
private :: X_t
type(X_t), parameter, public :: abc = X_t (12.34, 56.78)
end module
This was observed with several versions of gfortran, including the 4.1.0 IA64
release, the 4.3.0 20081222 snapshot for x86 windows, and the 4.4.0 20080219
snapshot for x86_64 linux.
Both ifort 10.1 and SGI IRIX f90 correctly reject the code. Interestingly,
Salford 5.10 (wrongly) accepts it.
--
Summary: Invalid-accepted - public entity with private type
should be diagnosed
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
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35395