public/private and overloaded operator



Dear group,
in a module I want to overload the operator + for two derived
types: t_a and t_b. The point is, I want t_a to be public (with its
overloaded +) and t_b to be private, so I came up with the following
code:

module mod_m

implicit none

public :: &
t_a, &
!t_b, &
operator(+)

private

type t_a
integer :: a
end type t_a

type t_b
real :: b
end type t_b

interface operator(+)
module procedure add_t_a, add_t_b
end interface

contains

pure function add_t_a(a1,a2) result(a)
type(t_a) :: a
type(t_a), intent(in) :: a1, a2

a%a = a1%a+a2%a
end function add_t_a

pure function add_t_b(b1,b2) result(b)
type(t_b) :: b
type(t_b), intent(in) :: b1, b2

b%b = b1%b+b2%b
end function add_t_b

end module mod_m


Now: gfortran and g95 compile the code, while ifort complains that

fortcom: Error: fquest.f90, line 33: The function result of this
module procedure is of a type that has PRIVATE accessibility and has a
generic identifier that has PUBLIC accessiblity. [ADD_T_B]
pure function add_t_b(b1,b2) result(b)
---------------^
fortcom: Error: fquest.f90, line 33: This dummy argument of this
module procedure is of a type that has PRIVATE accessibility and the
procedure has a generic identifier that has PUBLIC accessiblity.
[B1]
pure function add_t_b(b1,b2) result(b)
-----------------------^
fortcom: Error: fquest.f90, line 33: This dummy argument of this
module procedure is of a type that has PRIVATE accessibility and the
procedure has a generic identifier that has PUBLIC accessiblity.
[B2]
pure function add_t_b(b1,b2) result(b)
--------------------------^

Who is right?

GNU Fortran (GCC) 4.3.0 20071122 (experimental) [trunk revision
130342]
G95 (GCC 4.1.1 (g95 0.91!) Aug 20 2007)
ifort (IFORT) 10.1 20080212

Thank you,
Marco

.