diff options
author | Javier Miranda <miranda@adacore.com> | 2018-06-11 09:17:29 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-06-11 09:17:29 +0000 |
commit | 7ffe26fcf5c0ee0b4a6b3878859941fb534c9400 (patch) | |
tree | 3eb3dd9120792940d3acce64f62f039e73f7675a /gcc/ada/sinfo.adb | |
parent | 345bb755ae64b123f1cd5df9ed9b1be4f44c6f39 (diff) | |
download | gcc-7ffe26fcf5c0ee0b4a6b3878859941fb534c9400.zip gcc-7ffe26fcf5c0ee0b4a6b3878859941fb534c9400.tar.gz gcc-7ffe26fcf5c0ee0b4a6b3878859941fb534c9400.tar.bz2 |
[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
Diffstat (limited to 'gcc/ada/sinfo.adb')
-rw-r--r-- | gcc/ada/sinfo.adb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb index acb3215..45f2867 100644 --- a/gcc/ada/sinfo.adb +++ b/gcc/ada/sinfo.adb @@ -5350,6 +5350,8 @@ package body Sinfo is begin pragma Assert (False or else NT (N).Nkind = N_Allocator); + pragma Assert (not Val + or else not Is_Static_Coextension (N)); Set_Flag18 (N, Val); end Set_Is_Dynamic_Coextension; @@ -5613,6 +5615,8 @@ package body Sinfo is begin pragma Assert (False or else NT (N).Nkind = N_Allocator); + pragma Assert (not Val + or else not Is_Dynamic_Coextension (N)); Set_Flag14 (N, Val); end Set_Is_Static_Coextension; |