https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95647

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #9 from kargl at gcc dot gnu.org ---
(In reply to Jerry DeLisle from comment #8)
> (In reply to Jerry DeLisle from comment #6)
> > (In reply to Bill Long from comment #5)
> > > Is this fixed in a release version of GCC?
> > 
> > Submitting patch for approval and will backport as the fix is simple. How
> > far back shall we go? 10 for sure. Eyeballing the time lines, it does not
> > look like 9 will have any more releases.  If someone knows otherwise, let me
> > know.
> 
> While putting together a test case, I found another problem.
> 
> program test
>   use, intrinsic :: ieee_arithmetic, only :                 &
> &                ieee_class,                                       &
> &                ieee_class_type,                                  &
> &                ieee_negative_normal,                             &
> &                ieee_positive_normal,                             &
> &                operator(.eq.)
> !             use, intrinsic :: ieee_arithmetic
>   real(4) r4
>   type(ieee_class_type) class1
>   r4 = 1.0
>   class1 = ieee_class(r4)
>   if (class1 .eq. ieee_positive_normal) print *, 'yes'
>   if (class1 .ne. ieee_negative_normal) print *, 'yes'
>   r4 = -1.0
>   class1 = ieee_class(r4)
>   if (class1 .eq. ieee_negative_normal) print *, 'yes'
>   if (class1 .ne. ieee_positive_normal) print *, 'yes'
> end program test
> 
> $ gfc pr95647.f90 
> pr95647.f90:14:6:
> 
>    14 |   if (class1 .ne. ieee_negative_normal) print *, 'yes'
>       |      1
> Error: Operands of comparison operator ‘.ne.’ at (1) are
> TYPE(ieee_class_type)/TYPE(ieee_class_type)
> pr95647.f90:18:6:
> 
>    18 |   if (class1 .ne. ieee_positive_normal) print *, 'yes'
>       |      1
> Error: Operands of comparison operator ‘.ne.’ at (1) are
> TYPE(ieee_class_type)/TYPE(ieee_class_type)
> 
> There is more to the story apparently

gfortran is correct to issue an error.  You forgot to include
'operator(.ne.)' in the only clause of your test program.  Neither
'.ne.' nor '==' are overloaded for the class.

Reply via email to