[Ada] Process type extensions for -gnatw.h
This patch enables gap detection in type extensions.
With the -gnatw.h switch, on 64-bit machines,
the following test should get warnings:
gcc -c gaps.ads -gnatw.h
gaps.ads:16:07: warning: 48-bit gap before component "Comp2"
gaps.ads:17:07: warning: 8-bit gap before component "Comp3"
package Gaps is
type Integer_16 is mod 2**16;
type TestGap is tagged record
Comp1 : Integer_16;
end record;
for TestGap use record
Comp1 at 0 + 8 range 0..15;
end record;
type TestGap2 is new TestGap with record
Comp2 : Integer_16;
Comp3 : Integer_16;
end record;
for TestGap2 use record
Comp2 at 08 + 8 range 0..15;
Comp3 at 11 + 8 range 0..15;
end record;
end Gaps;
2019-08-19 Bob Duff <duff@adacore.com>
gcc/ada/
* sem_ch13.adb (Record_Hole_Check): Procedure to check for holes
that incudes processing type extensions. A type extension is
processed by first calling Record_Hole_Check recursively on the
parent type to compute the bit number after the last component
of the parent.
From-SVN: r274653