]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Emit more warnings on unsupported overlay
authorMarc Poulhiès <poulhies@adacore.com>
Tue, 25 Feb 2025 15:50:04 +0000 (16:50 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 9 Jun 2025 06:32:05 +0000 (08:32 +0200)
commit5069485475173307d5144c60d63651ca3b56b6fb
treed7a5534b922d2c7b11b929678f3a380db3491f05
parent250392311d5bc6d167f87d4ad65c3e9df8981fba
ada: Emit more warnings on unsupported overlay

In the case where the overlaid object is nested in a record or is an
array element as in:

    for Foo'Address use Item.Nested_Item'Address;
or  for Foo'Address use Item (Bar)'Address;

the compiler was not emitting a warning in case of differing
Scalar_Storage_Order values.

gcc/ada/ChangeLog:

* sem_util.adb (Find_Overlaid_Entity): Add extra parameter to
extract the type being overlaid.
(Note_Possible_Modification): Adjust call to Find_Overlaid_Entity.
(Ultimate_Overlaid_Entity): Likewise.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Likewise.
* sem_util.ads (Find_Overlaid_Entity): Add extra parameter to
extract the type being overlaid.
* freeze.adb (Check_Address_Clause): Likewise.
gcc/ada/freeze.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads