[Ada] Spurious Storage_Error on imported array
authorHristian Kirtchev <kirtchev@adacore.com>
Wed, 23 May 2018 10:23:54 +0000 (10:23 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 23 May 2018 10:23:54 +0000 (10:23 +0000)
commit7f4b58c2582067694e7f9e8944187ac5794579d0
tree49507a77bed0132522ea627c9d9f0941f6996e6d
parentffdd52487888d3c45cf02e66b79587d2cf2839a3
[Ada] Spurious Storage_Error on imported array

This patch moves the check which verifies that a large modular array is created
from expansion to freezing in order to take interfacing pragmas in account. The
check is no longer performed on imported objects because no object is created
in that case.

2018-05-23  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* exp_ch3.adb (Check_Large_Modular_Array): Moved to Freeze.
(Expand_N_Object_Declaration): Do not check for a large modular array
here.
* freeze.adb (Check_Large_Modular_Array): Moved from Exp_Ch3.
(Freeze_Object_Declaration): Code cleanup. Check for a large modular
array.
* sem_ch3.adb: Minor reformatting.

gcc/testsuite/

* gnat.dg/import2.adb: New testcase.

From-SVN: r260597
gcc/ada/ChangeLog
gcc/ada/exp_ch3.adb
gcc/ada/freeze.adb
gcc/ada/sem_ch3.adb
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/import2.adb [new file with mode: 0644]