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

--- Comment #12 from janus at gcc dot gnu.org ---
(In reply to Tobias Burnus from comment #10)
> (In reply to janus from comment #7)
> > The following patch makes the error go away, but (as expected) causes a
> > failure of proc_ptr_result_8.f90 in the testsuite ...
> > -      if (!gfc_compare_interfaces (s2, s1, name, 0, 1,
> > -                              err, sizeof(err), NULL, NULL))
> > -   {
> > -     gfc_error ("Interface mismatch in procedure pointer assignment "
> > -                "at %L: %s", &rvalue->where, err);
> > -     return false;
> > -   }
> 
> 
> Doesn't that remove too much? I had expected some special case for PURE,
> while checking otherwise that the interface matches.

No, I don't think it removes too much. It seems that the other parts of
'gfc_compare_interfaces' are already symmetrized appropriately, expect for the
check on the result characteristics.


> Side note: The following compiles but should give an error as the interface
> doesn't match. (If one swaps the pure, it does and should compile warning
> free.)
> 
> subroutine foo()
> end
> 
> interface
>   pure subroutine foo()
>   end subroutine foo
> end interface
> call foo()
> end

Well, it does give the expected warning with the patch:

  pure subroutine foo()
                     1
Warning: Interface mismatch in global procedure 'foo' at (1): Mismatch in PURE
attribute

Reply via email to