public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51076] New: [F2008][tracking] Pointer initialization in init expression
@ 2011-11-10 10:42 burnus at gcc dot gnu.org
  2014-03-15 11:12 ` [Bug fortran/51076] " dominiq at lps dot ens.fr
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-11-10 10:42 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51076
           Summary: [F2008][tracking] Pointer initialization in init
                    expression
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
        Depends on: 45290


The example is motivated by the discussion at
  http://j3-fortran.org/pipermail/j3/2011-November/004840.html

It seems as is using
  type(T) :: X = t(tgt)
is (should be) valid while using
  type(T), PARAMTER :: X = t(tgt)
is (should be) invalid.

Currently, gfortran rejects both. Note that this is a tracking bug as one
seemingly needs to modify the wording to explicitly forbid the usage as
PARAMETER, which is technically impossible to implement.


 type(T) :: X = t(tgt) ! Check fails
                  1
Error: Parameter 'tgt' at (1) has not been declared or is a variable, which
does not reduce to a constant expression


 type :: t
   integer, pointer :: P
 end type t
 integer, target, save :: tgt
 type(T) :: X = t(tgt) ! (1) - a constness check fails
 type(T) :: Y
 Y = t(tgt)   ! (2) Accepted
 Y = t(P=tgt) ! (3) Accepted
end


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

end of thread, other threads:[~2015-08-30 10:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-10 10:42 [Bug fortran/51076] New: [F2008][tracking] Pointer initialization in init expression burnus at gcc dot gnu.org
2014-03-15 11:12 ` [Bug fortran/51076] " dominiq at lps dot ens.fr
2015-01-16 12:54 ` janus at gcc dot gnu.org
2015-08-30 10:14 ` 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).