[Ada] Wrong code in array aggregates of Ada coextensions
authorJavier Miranda <miranda@adacore.com>
Mon, 11 Jun 2018 09:17:29 +0000 (09:17 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 11 Jun 2018 09:17:29 +0000 (09:17 +0000)
commit7ffe26fcf5c0ee0b4a6b3878859941fb534c9400
tree3eb3dd9120792940d3acce64f62f039e73f7675a
parent345bb755ae64b123f1cd5df9ed9b1be4f44c6f39
[Ada] Wrong code in array aggregates of Ada coextensions

The compiler generates wrong code when an array aggregate with an others choice
whose expression has nested object allocations (ie. others => new R (new S)) is
used to initialize an array of access to discriminated types whose discriminant
is an access type.

2018-06-11  Javier Miranda  <miranda@adacore.com>

gcc/ada/

* sinfo.ads (Is_Dynamic_Coextension): Adding documentation.
(Is_Static_Coextension): Adding documentation.
* sinfo.adb (Is_Dynamic_Coextension): Extending the assertion.
(Is_Static_Coextension): Extending the assertion.
* sem_util.adb (Mark_Allocator): Clear Is_Static_Coextension when
setting flag Is_Dynamic_Coextension (and vice versa).

gcc/testsuite/

* gnat.dg/aggr23.adb, gnat.dg/aggr23_q.adb, gnat.dg/aggr23_tt.ads: New
testcase.

From-SVN: r261406
gcc/ada/ChangeLog
gcc/ada/sem_util.adb
gcc/ada/sinfo.adb
gcc/ada/sinfo.ads
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/aggr23.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/aggr23_q.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/aggr23_tt.ads [new file with mode: 0644]