ada: Allow passing private types to generic formal incomplete types
commit1e2a2daa773e9d9e7638849af4c03f2636f1f07b
authorBob Duff <duff@adacore.com>
Wed, 13 Dec 2023 19:36:27 +0000 (13 14:36 -0500)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 9 Jan 2024 13:13:32 +0000 (9 14:13 +0100)
treeb018c9c77b013c08b11c748514875d8112f7fb12
parent8ca25eacaa326022bd2f3e2ffc8a690a9d7363d0
ada: Allow passing private types to generic formal incomplete types

It is legal to pass a private type, or a type with a component whose
type is private, as a generic actual type if the formal is a generic
formal incomplete type. This patch fixes a bug in which the compiler
would give an error in some such cases.

Also misc cleanup.

gcc/ada/

* sem_ch12.adb (Instantiate_Type): Make the relevant error message
conditional upon "Ekind (A_Gen_T) /= E_Incomplete_Type". Misc
cleanup.
gcc/ada/sem_ch12.adb