This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/39800] Rejects PRIVATE TYPE as compont of local type declaration



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]