public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/102745] New: CLASS → TYPE check fails after RESHAPE
@ 2021-10-14 14:16 burnus at gcc dot gnu.org
  2021-10-18  7:49 ` [Bug fortran/102745] " cvs-commit at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-10-14 14:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102745
           Summary: CLASS → TYPE check fails after RESHAPE
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

Found when working on PR102689

Expected:
* 'CLASS(t)' in the first error message
* an error for passing CLASS(t) to TYPE(t2) in the call with RESHAPE.


implicit none (type, external)
type t
end type t
type, extends(t) :: t2
  integer :: i
end type t2

class(t), allocatable :: A(:), B(:,:,:)

allocate (t2 :: A(100), B(10,10,1))

call bar(A)  ! Rejected (with slightly odd message: Error: Type mismatch in
argument ‘x’ at (1); passed CLASS(__class_MAIN___T_1_0a) to TYPE(t2)
call bar(reshape(B, [size(B)]))  ! Wrongly accepted

contains

subroutine bar(x)
  type(t2), intent(in) :: x(:)
end
end

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

end of thread, other threads:[~2021-11-23  8:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 14:16 [Bug fortran/102745] New: CLASS → TYPE check fails after RESHAPE burnus at gcc dot gnu.org
2021-10-18  7:49 ` [Bug fortran/102745] " cvs-commit at gcc dot gnu.org
2021-10-19  8:52 ` cvs-commit at gcc dot gnu.org
2021-10-19 10:38 ` burnus at gcc dot gnu.org
2021-11-23  8:03 ` pinskia 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).