]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix spurious error on 'Input of private type with Type_Invariant aspect
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 25 Jul 2023 21:03:22 +0000 (23:03 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 3 Aug 2023 12:07:36 +0000 (14:07 +0200)
commit3b21dae599fe172c786836da508bad91372b4d09
treefc91e3f362ba268a2c9ae6a7e139b00152e9b3c9
parent5825635336fec18a26cd17cf47ccf97ed8eb2756
ada: Fix spurious error on 'Input of private type with Type_Invariant aspect

The problem is that it is necessary to break the privacy during the
expansion of the Input attribute, which may introduce a view mismatch
with the parameter of the routine checking the invariant of the type.

gcc/ada/

* exp_util.adb (Make_Invariant_Call): Convert the expression to
the type of the formal parameter if need be.
gcc/ada/exp_util.adb