diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-01-09 10:46:23 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2024-01-09 10:49:17 +0100 |
commit | 436ce7a3510000e0939094592fc12353e17527f1 (patch) | |
tree | eec00a7f5a0334ef5bae1f1c1671a19483be9325 /gcc/cp/constexpr.cc | |
parent | b1d4e5b51375efd285378173375d634ad6ba8462 (diff) | |
download | gcc-436ce7a3510000e0939094592fc12353e17527f1.zip gcc-436ce7a3510000e0939094592fc12353e17527f1.tar.gz gcc-436ce7a3510000e0939094592fc12353e17527f1.tar.bz2 |
Fix internal error on function call returning extension of limited interface
This is a regression present on the mainline and 13 branch, in the form of a
series of internal errors (3) on a function call returning the extension of
a limited interface.
This is only a partial fix for the first two assertion failures; the third
one is the most problematic and will be dealt with separately.
The first issue is in Instantiate_Type, where we use Base_Type in a specific
case to compute the ancestor of a derived type, which will later trigger the
assertion on line 16960 of sem_ch3.adb since Parent_Base and Generic_Actual
are the same node. This is changed to use Etype like in other cases around.
The second issue is an unprotected use of Designated_Type on type T in
Analyze_Explicit_Dereference, while another use in an equivalent context
is guarded by Is_Access_Type a few lines above.
gcc/ada
PR ada/112781
* sem_ch12.adb (Instantiate_Type): Use Etype instead of Base_Type
consistently to retrieve the ancestor for a derived type.
* sem_ch4.adb (Analyze_Explicit_Dereference): Test Is_Access_Type
consistently before accessing Designated_Type.
Diffstat (limited to 'gcc/cp/constexpr.cc')
0 files changed, 0 insertions, 0 deletions