This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: Regression: import clashes with generic


Hi Damian,

> The code below compiles with gfortran 4.7.1 but not with 4.8.
> Commenting out the "import" statement eliminates the compile-time
> error.   Is this a known issue or should I submit a bug report?

thanks for the bug report. I think this problem was not known so far,
and apparently Tobias has already opened a PR:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54195

I remember committing some fixes for operators and generics some time
ago. Probably one of those is to blame. Will look into it soon ...

Cheers,
Janus



> $ cat import_clashes_with_generic.f90
> module import_clashes_with_generic
>
>   type ,abstract :: foo
>   contains
>     procedure :: unary
>     generic :: operator(-) => unary
>   end type
>
>   abstract interface
>     integer function bar()
>       import :: foo
>     end function
>   end interface
>
> contains
>
>   integer function unary(rhs)
>     class(foo) ,intent(in) :: rhs
>   end function
>
> end module
>
> $ gfortran-mp-4.8 -c import_clashes_with_generic.f90
> import_clashes_with_generic.f90:6.29:
>
>     generic :: operator(-) => unary
>                              1
> Error: Entity 'unary' at (1) is already present in the interface


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