public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51945] New: Diagnose wrong default initialization of DTs in a DT declaration
@ 2012-01-22 17:05 burnus at gcc dot gnu.org
  2013-08-08 16:49 ` [Bug fortran/51945] " dominiq at lps dot ens.fr
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-01-22 17:05 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51945
           Summary: Diagnose wrong default initialization of DTs in a DT
                    declaration
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


The following program compiles without any error, until one uncomments the
type-declaration line. If one does, one gets the expected error.

Expected: One already gets an error without using the declared type.

The current error is most confusing if one has the type decalaration in a
module as one then gets:

use m
    1
Error: Can't convert TYPE(t3) to TYPE(t) at (1)


type t
integer :: i = 3
end type t

type, extends(t) ::  t2
end type t2

type ::  t3
integer :: i = 78
end type t3

type my_t
  type(t) :: x = t() ! OK
  type(t) :: y = t2() ! Invalid
  type(t) :: z = t3() ! Invalid
end type my_t

!type(my_t) :: a
end


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

end of thread, other threads:[~2014-05-04 14:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-22 17:05 [Bug fortran/51945] New: Diagnose wrong default initialization of DTs in a DT declaration burnus at gcc dot gnu.org
2013-08-08 16:49 ` [Bug fortran/51945] " dominiq at lps dot ens.fr
2013-08-08 18:31 ` janus at gcc dot gnu.org
2013-08-08 18:38 ` janus at gcc dot gnu.org
2013-08-08 19:46 ` janus at gcc dot gnu.org
2013-08-08 20:56 ` janus at gcc dot gnu.org
2013-08-08 21:18 ` janus at gcc dot gnu.org
2013-08-10 11:28 ` janus at gcc dot gnu.org
2014-05-04 14:02 ` dominiq at lps dot ens.fr

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).