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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

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

--- Comment #10 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(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. (Except for the case where the
proc-pointer only has an implicit interface like for "procedure(real)", unless
some characteristic of the RHS requires an explicit interface.)

* * *

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

Reply via email to