This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/39800] Rejects PRIVATE TYPE as compont of local type declaration
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Apr 2009 20:36:01 -0000
- Subject: [Bug fortran/39800] Rejects PRIVATE TYPE as compont of local type declaration
- References: <bug-39800-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from burnus at gcc dot gnu dot org 2009-04-18 20:35 -------
> > Thus there are two bugs:
> > - Local TYPE declarations in procedures are wrongly rejected
> by local, I suppose that you mean host associated?
No, I mean:
subroutine sub()
TYPE :: new_local_type
type(foo) :: x
Here, it does not matter whether "foo" is host or use associated or has a local
scope. It is simply a TYPE which is entirely restricted to "sub" and procedures
contained in "sub" and thus there cannot be any use-association problem.
A different matter is:
subroutine sub2(x)
TYPE :: local_type; SEQUENCE; type(foo) :: y; end type
type(local_type) :: x
Then the problem (in F95) is that "x" is a dummy while type(local_type)
contains a private element. Gfortran properly rejects this with -std=f95 and
accepts it otherwise.
> I would put the first bug as being very high in embarrassment:-(
Indeed. I'm surprised that it did not appear earlier, but I checked: it is not
a regression.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39800