From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.50.142.39 with SMTP id rt7mr3254117igb.5.1432275815930; Thu, 21 May 2015 23:23:35 -0700 (PDT) X-Received: by 10.50.79.164 with SMTP id k4mr59183igx.6.1432275815909; Thu, 21 May 2015 23:23:35 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!h15no7503798igd.0!news-out.google.com!kd3ni24407igb.0!nntp.google.com!j8no7743749igd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 21 May 2015 23:23:35 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=24.87.14.133; posting-account=gch_qAkAAAAnG6EzLAhbH2mm5rvpLHgQ NNTP-Posting-Host: 24.87.14.133 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: GNAT bugs around use of "for X'Address..." clause From: erik.shadwick@gmail.com Injection-Date: Fri, 22 May 2015 06:23:35 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:25934 Date: 2015-05-21T23:23:35-07:00 List-Id: Consider the following declarations: package P is type Checked_T is private with Type_Invariant =3D> Check (Checked_T); type Tagged_T is tagged private; type Checked_Tagged_T is tagged private with Type_Invariant =3D> Check (Checked_Tagged_T); function Check (M : Checked_T) return Boolean with Inline; function Check (M : Checked_Tagged_T) return Boolean with Inline; private type Checked_T is null record; type Tagged_T is tagged null record; type Checked_Tagged_T is tagged null record; function Check (M : Checked_T) return Boolean is (True); function Check (M : Checked_Tagged_T) return Boolean is (True); end P; Then the following 3 declarations each produce [similar] GNAT BUG DETECTED = output: X : P.Checked_T; for X'Address use System.Null_Address; -- However, if I do something like: -- V : P.Checked_T; -- X : P.Checked_T :=3D V; -- for X'Address use ...; -- then no bug surfaces. W : P.Tagged_T; Y : P.Tagged_T :=3D W; for Y'Address use System.Null_Address; -- If I do not perform the ":=3D W", then it works fine. =20 Z : P.Checked_Tagged_T; for Z'Address use System.Null_Address; -- With or without assignment to Z in its declaration, it fails. (Compiled with `gnatmake -gnat2012`, with "GPL 2014 (20140331) (x86_64-appl= e-darwin12.5.0)") Should I be submitting this to AdaCore, or GCC's http://gcc.gnu.org/bugs.ht= ml bug tracker? When running this with my copy of GNAT free/GPL, it suggest= s the former, but when compiling it through ideone.com I get the message to= put it into GCC's tracker. It detects the error in "in gnat_to_gnu_entity,= at ada/gcc-interface/decl.c:347". Further, what is the validity of assigning to a variable that has the 'Addr= ess clause on it -- is it legal and defined behaviour? -- Erik Shadwick