public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/61615] New: Failure to resolve correct generic with TYPE(C_PTR) arguments
@ 2014-06-25 22:48 thatcadguy at gmail dot com
  2014-06-27 14:47 ` [Bug fortran/61615] " thatcadguy at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: thatcadguy at gmail dot com @ 2014-06-25 22:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61615
           Summary: Failure to resolve correct generic with TYPE(C_PTR)
                    arguments
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thatcadguy at gmail dot com

The following program does not produce the expected output (the line 'CALL
bar(a, b)' does not choose the subroutine bar_s as it should, it chooses
bar_a1d):

MODULE foo
  USE iso_c_binding
  IMPLICIT NONE
  INTERFACE bar
    MODULE PROCEDURE bar_s
    MODULE PROCEDURE bar_a1d
  END INTERFACE bar
CONTAINS
  SUBROUTINE bar_s(a, b)
    TYPE(c_ptr) :: a, b
    WRITE (0, *) 'in bar_s'
  END SUBROUTINE bar_s

  SUBROUTINE bar_a1d(a, b)
    TYPE(c_ptr) :: a(:), b(:)
    WRITE (0, *) 'in bar_a1d'
  END SUBROUTINE bar_a1d
END MODULE foo

PROGRAM cptr_array_vs_scalar_arg
  USE foo
  USE iso_c_binding
  IMPLICIT NONE
  INTEGER, TARGET :: i
  TYPE(c_ptr) :: a, b
  a = C_LOC(i)
  b = C_LOC(i)
  CALL bar(a, b)
END PROGRAM cptr_array_vs_scalar_arg


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-04-23 18:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-25 22:48 [Bug fortran/61615] New: Failure to resolve correct generic with TYPE(C_PTR) arguments thatcadguy at gmail dot com
2014-06-27 14:47 ` [Bug fortran/61615] " thatcadguy at gmail dot com
2014-07-12 22:19 ` dominiq at lps dot ens.fr
2014-07-13 15:09 ` dominiq at lps dot ens.fr
2014-07-13 15:39 ` anlauf at gmx dot de
2014-07-13 16:08 ` dominiq at lps dot ens.fr
2015-10-09  8:58 ` dominiq at lps dot ens.fr
2023-04-11 14:56 ` anlauf at gcc dot gnu.org
2023-04-12  9:14 ` cvs-commit at gcc dot gnu.org
2023-04-12  9:21 ` anlauf at gcc dot gnu.org
2023-04-23 18:53 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).