diff options
| author | Eric Botcazou <ebotcazou@adacore.com> | 2025-11-04 19:54:45 +0100 |
|---|---|---|
| committer | Eric Botcazou <ebotcazou@adacore.com> | 2025-11-04 20:08:48 +0100 |
| commit | 8836210fb62058980aeb02d6aad7f6dbca87b50b (patch) | |
| tree | cc9f82d07c8e1e7f9812f55039f5b7a9bf0d8eb5 /libgrust/rustc-lib/stdarch/crates/assert-instr-macro/src | |
| parent | 4cad566793d0a2587a10f9669dfd0f5cdbd6d82d (diff) | |
| download | gcc-8836210fb62058980aeb02d6aad7f6dbca87b50b.zip gcc-8836210fb62058980aeb02d6aad7f6dbca87b50b.tar.gz gcc-8836210fb62058980aeb02d6aad7f6dbca87b50b.tar.bz2 | |
Ada: Fix incorrect legality check in instantiation of child generic unit
The problem arises when the generic unit has a formal access type parameter,
because the manual resolution implemented in Find_Actual_Type does not pick
the correct entity for the designated type. The fix replaces it with a bona
fide resolution and cleans up the associated code in the callers.
gcc/ada/
PR ada/18453
* sem_ch12.adb (Find_Actual_Type): Add Typ_Ref parameter and
perform a standard resolution on it in the fallback case.
Call Get_Instance_Of if the type is declared in a formal of
the child unit.
(Instantiate_Type.Validate_Access_Type_Instance): Adjust call
to Find_Actual_Type.
(Instantiate_Type.Validate_Array_Type_Instance): Likewise and
streamline the check for matching component subtypes.
gcc/testsuite/
* gnat.dg/specs/generic_inst9.ads: New test.
* gnat.dg/specs/generic_inst9_pkg1.ads: New helper.
* gnat.dg/specs/generic_inst9_pkg2.ads: Likewise.
* gnat.dg/specs/generic_inst9_pkg2-g.ads: Likewise.
Diffstat (limited to 'libgrust/rustc-lib/stdarch/crates/assert-instr-macro/src')
0 files changed, 0 insertions, 0 deletions
