public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/70867] [9/10/11/12 regression] access discriminant in return aggregate wrongly detected as dangling
       [not found] <bug-70867-4@http.gcc.gnu.org/bugzilla/>
@ 2021-05-14  9:48 ` jakub at gcc dot gnu.org
  2021-06-01  8:07 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-14  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|8.5                         |9.4

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 8 branch is being closed.

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

* [Bug ada/70867] [9/10/11/12 regression] access discriminant in return aggregate wrongly detected as dangling
       [not found] <bug-70867-4@http.gcc.gnu.org/bugzilla/>
  2021-05-14  9:48 ` [Bug ada/70867] [9/10/11/12 regression] access discriminant in return aggregate wrongly detected as dangling jakub at gcc dot gnu.org
@ 2021-06-01  8:07 ` rguenth at gcc dot gnu.org
  2021-06-10 17:25 ` demoonlit at panathenaia dot halfmoon.jp
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:07 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

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

* [Bug ada/70867] [9/10/11/12 regression] access discriminant in return aggregate wrongly detected as dangling
       [not found] <bug-70867-4@http.gcc.gnu.org/bugzilla/>
  2021-05-14  9:48 ` [Bug ada/70867] [9/10/11/12 regression] access discriminant in return aggregate wrongly detected as dangling jakub at gcc dot gnu.org
  2021-06-01  8:07 ` rguenth at gcc dot gnu.org
@ 2021-06-10 17:25 ` demoonlit at panathenaia dot halfmoon.jp
  2021-07-31 20:11 ` simon at pushface dot org
  2021-09-10 11:17 ` ebotcazou at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: demoonlit at panathenaia dot halfmoon.jp @ 2021-06-10 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from yuta tomino <demoonlit at panathenaia dot halfmoon.jp> ---
Sorry, perhaps my example is illegal in Ada 2012.
"aliased" is required to return a reference of a part of the parameter.

Randy explained the change in
https://groups.google.com/g/comp.lang.ada/c/7dw7Oqi8lIk/m/5NUBhFN8DQAJ .
(I wonder if it was legal before Ada 2005?? Because aliased parameter is added
in Ada 2012 and the relevant text has been changed by AI05-0234-1.)

I think Nicolas's example is always legal.

Thanks.

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

* [Bug ada/70867] [9/10/11/12 regression] access discriminant in return aggregate wrongly detected as dangling
       [not found] <bug-70867-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-06-10 17:25 ` demoonlit at panathenaia dot halfmoon.jp
@ 2021-07-31 20:11 ` simon at pushface dot org
  2021-09-10 11:17 ` ebotcazou at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: simon at pushface dot org @ 2021-07-31 20:11 UTC (permalink / raw)
  To: gcc-bugs

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

simon at pushface dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon at pushface dot org

--- Comment #14 from simon at pushface dot org ---
(In reply to Nicolas Boulenguez from comment #0)
> Hello.
> With GCC-6 (Debian 6.0.1-2) 6.0.1 20160423 (prerelease),
> compiling the following package with "gcc-6 -c p.adb" fails:
> p.adb:4:20: access discriminant in return aggregate would be a dangling
> reference
> The code compiles
> - if the "generic" line is removed
> - or if ".all" is inserted between "Position" and ".Item'Access"
> I am not sure whether returning this reference is allowed by the Ada
> Reference Manual,
> but the semantics of "generic" and ".all" should certainly not affect the
> answer.

GCC 11.1.0, x86_64-apple-darwin on macOS 11.6 (Big Sur):

This compiles without error, and the example below executes correctly.

with P;
with Ada.Text_IO;
procedure P_Test is
   package Q is new P;
   R : aliased Q.R := (Item => 42);
   T : Q.T := Q.F (R'Access);
begin
   Ada.Text_IO.Put_Line (T.D.all'Image);
end P_Test;

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

* [Bug ada/70867] [9/10/11/12 regression] access discriminant in return aggregate wrongly detected as dangling
       [not found] <bug-70867-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-07-31 20:11 ` simon at pushface dot org
@ 2021-09-10 11:17 ` ebotcazou at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-09-10 11:17 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|9.5                         |11.0

--- Comment #15 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
.

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

end of thread, other threads:[~2021-09-10 11:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-70867-4@http.gcc.gnu.org/bugzilla/>
2021-05-14  9:48 ` [Bug ada/70867] [9/10/11/12 regression] access discriminant in return aggregate wrongly detected as dangling jakub at gcc dot gnu.org
2021-06-01  8:07 ` rguenth at gcc dot gnu.org
2021-06-10 17:25 ` demoonlit at panathenaia dot halfmoon.jp
2021-07-31 20:11 ` simon at pushface dot org
2021-09-10 11:17 ` ebotcazou at gcc dot gnu.org

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