]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix wrong finalization for qualified aggregate of limited type in allocator
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 16 Nov 2023 18:45:41 +0000 (19:45 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 30 Nov 2023 10:12:46 +0000 (11:12 +0100)
commit2a50a4d4bca09c1c1b255f3ce6c06be57f62889b
treea6926631809b75fd4fd794ff395f7928424cc5c8
parentab0efa304ffd7139105139c90de63ca0651ef274
ada: Fix wrong finalization for qualified aggregate of limited type in allocator

This happens with -gnata when the limited type has controlled components
and a predicate, because the predicate check generated for the aggregate
causes the creation of a temporary that is used as the expression of the
allocator.  Now this combination is illegal for a limited type, so the
compiler does not generate the deep adjustment that would be necessary
for the access value, which ultimately results in a wrong finalization.

gcc/ada/

* checks.adb (Apply_Predicate_Check): Also deal specifically with
an expression that is a qualified aggregate in an allocator.
gcc/ada/checks.adb