public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51208] New: [OOP] ALLOCATE with SOURCE= or MOLD=: Diagnose if variable occurs twice
@ 2011-11-18 10:54 burnus at gcc dot gnu.org
  2011-11-18 16:10 ` [Bug fortran/51208] " kargl at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-11-18 10:54 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51208
           Summary: [OOP] ALLOCATE with SOURCE= or MOLD=: Diagnose if
                    variable occurs twice
    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


In ALLOCATE, one gets a diagnosis if one uses:

   integer, allocatable :: i
   allocate(i, stat=i)
   end

Namely:
   allocate(i, stat=i)
                 1
   Error: Stat-variable at (1) shall not be ALLOCATEd within
          the same ALLOCATE statement

However, for SOURCE= and MOLD= it does not work:

  type t
    integer :: i = 4
  end type t
  class(t), allocatable :: x, y

  allocate(t :: y)
  allocate(x, mold=x)   ! Not diagnosed
  allocate(x, source=x) ! Not diagnosed


The Intel compiler gives the error:
  error #8152: Neither the ERRMSG= variable nor any part of the source
  expression in SOURCE= or MOLD= specifiers may be allocated in the
  ALLOCATE statement in which it appears.   [X]


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

end of thread, other threads:[~2013-01-07 23:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-18 10:54 [Bug fortran/51208] New: [OOP] ALLOCATE with SOURCE= or MOLD=: Diagnose if variable occurs twice burnus at gcc dot gnu.org
2011-11-18 16:10 ` [Bug fortran/51208] " kargl at gcc dot gnu.org
2011-11-18 16:12 ` burnus at gcc dot gnu.org
2011-11-18 19:03 ` sgk at troutmask dot apl.washington.edu
2011-11-18 19:07 ` burnus at gcc dot gnu.org
2011-11-18 19:55 ` sgk at troutmask dot apl.washington.edu
2013-01-07 23:16 ` dominiq at lps dot ens.fr
2013-01-07 23:37 ` sgk at troutmask dot apl.washington.edu

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