]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix internal error on container aggregate for bounded vectors
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 18 Dec 2024 09:16:15 +0000 (10:16 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 7 Jan 2025 12:33:33 +0000 (13:33 +0100)
commitce13a3a47865387abac8c9ecf0e2bc4d63bada1b
tree47084a8b5d1c0a7fdebacf31d694c4c44e4bf706
parentc7799a8108e2e53e80d41281e5625b78236d039a
ada: Fix internal error on container aggregate for bounded vectors

The problem is that we analyze references to an object before the actual
subtype of the object is established, thus creating a type mismatch that
is flagged by the code generator.

gcc/ada/ChangeLog:

* exp_ch7.ads (Store_After_Actions_In_Scope_Without_Analysis): New
procedure declaration.
* exp_ch7.adb (Store_New_Actions_In_Scope): New procedure.
(Store_Actions_In_Scope): Call Store_New_Actions_In_Scope when the
target list is empty.
(Store_After_Actions_In_Scope_Without_Analysis): New procedure body.
* exp_aggr.adb (Expand_Container_Aggregate): For a declaration that
is wrapped in a transient scope, also defer the analysis of the new
code until after the declaration is analyzed.
gcc/ada/exp_aggr.adb
gcc/ada/exp_ch7.adb
gcc/ada/exp_ch7.ads