A recent change removed rewriting of address of a slice into address of first
component of a slice. Now we need to explicitly detect overlying with slices.
Together, both changes cause warnings to be emitted when slice of a constant
object is overlaid by a variable.
gcc/ada/ChangeLog:
* sem_util.adb (Find_Overlaid_Entity): Detect overlying with slice.
-- Check for components
- elsif Nkind (Expr) in N_Selected_Component | N_Indexed_Component then
+ elsif Nkind (Expr) in N_Indexed_Component
+ | N_Selected_Component
+ | N_Slice
+ then
Expr := Prefix (Expr);
Off := True;