public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gerhard.steinmetz.fortran@t-online.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/66545] ICE on using undefined parameter/variable values
Date: Mon, 15 Jun 2015 19:03:00 -0000	[thread overview]
Message-ID: <bug-66545-4-RmSISbAZjn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66545-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
FYI, it's astonishing, but this code compiles without an ICE
and prints some reasonable error messages :


$ cat z2_type.f90
program p
   type t
      integer :: n
   end type
   type(t), parameter :: c1 = (t(c1%n))
   type(t), parameter :: c2 = t(c2%n)
   type(t) :: c3 = (t(c3%n))
   type(t) :: c4 = t(c4%n)
   type(t) :: c5
   type(t) :: c6
   c5 = (t(c5%n))
   c6 = t(c6%n)
end


$ gfortran -c z2_type.f90
z2_type.f90:5:33:

    type(t), parameter :: c1 = (t(c1%n))
                                 1
Error: PARAMETER ‘c1’ is used at (1) before its definition is complete
z2_type.f90:6:32:

    type(t), parameter :: c2 = t(c2%n)
                                1
Error: PARAMETER ‘c2’ is used at (1) before its definition is complete
z2_type.f90:7:22:

    type(t) :: c3 = (t(c3%n))
                      1
Error: Parameter ‘c3’ at (1) has not been declared or is a variable, which does
not reduce to a constant expression
z2_type.f90:8:21:

    type(t) :: c4 = t(c4%n)
                     1
Error: Parameter ‘c4’ at (1) has not been declared or is a variable, which does
not reduce to a constant Expression

#
# c5, c6 differs
#
>From gcc-bugs-return-489032-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jun 15 19:27:56 2015
Return-Path: <gcc-bugs-return-489032-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 130671 invoked by alias); 15 Jun 2015 19:27:55 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 130629 invoked by uid 48); 15 Jun 2015 19:27:51 -0000
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/51048] Class template inheritance doesn't work well with function-local types
Date: Mon, 15 Jun 2015 19:27:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.7.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: paolo.carlini at oracle dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 6.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution assigned_to target_milestone
Message-ID: <bug-51048-4-4RGhJd90WS@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-51048-4@http.gcc.gnu.org/bugzilla/>
References: <bug-51048-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-06/txt/msg01364.txt.bz2
Content-length: 575

https://gcc.gnu.org/bugzilla/show_bug.cgi?idQ048

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
           Assignee|paolo.carlini at oracle dot com    |unassigned at gcc dot gnu.org
   Target Milestone|---                         |6.0

--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed.


  parent reply	other threads:[~2015-06-15 19:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15 17:19 [Bug fortran/66545] New: " gerhard.steinmetz.fortran@t-online.de
2015-06-15 17:20 ` [Bug fortran/66545] " gerhard.steinmetz.fortran@t-online.de
2015-06-15 19:03 ` gerhard.steinmetz.fortran@t-online.de [this message]
2015-06-15 20:12 ` tkoenig at gcc dot gnu.org
2015-06-15 20:28 ` kargl at gcc dot gnu.org
2015-06-15 21:19 ` tkoenig at gcc dot gnu.org
2015-06-15 21:35 ` sgk at troutmask dot apl.washington.edu
2015-06-16 19:59 ` tkoenig at gcc dot gnu.org
2015-07-02 17:02 ` kargl at gcc dot gnu.org
2015-07-16 19:04 ` kargl at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-66545-4-RmSISbAZjn@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).