https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62176
Bug ID: 62176
Summary: [OOP] Inconsistent resolution of GENERIC interface
Product: gcc
Version: 4.9.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: fmartinez at gmv dot com
Created attachment 33355
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33355&action=edit
Source file generating the compilation errors
Dear all.
The attached module does not compile producing the following message associated
to the generic interface lgt (similar for all other three comparison operators)
...
m_string.f90:141.23:
generic :: lgt => string_greater_string, &
1
Error: 'string_greater_char' and 'char_greater_string' for GENERIC 'lgt' at (1)
are ambiguous
...
The inconsistency comes from the us of the char_greater_string and
string_greater_char procedures, which are the implementation of the overloaded
function lgt and also of the operator(>). The compiler complains about the
ambiguity of interfaces for lgt but not for the operator(>).
This overloading is meant to cover the cases c > s and s > c (begin c a
character string and s a t_string type object). Also the cases lgt(c,s) and
lgt(s,c).
The versions that have c on left hand side of the operation have the
pass(right) attibute properly (i belive) assigned to allow that the procedure
is bound to the object according to the second parameter of the function call.
Thanks
Fran