This patch fixes an issue in the compiler whereby a class-wide allocator for a type declared within a generic formal package was not treated the same as a formal type with respect to accessibility checks - leading to spurious accessibility errors. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb, sem_util.ads (In_Generic_Formal_Package): Created to identify type declarations occurring within generic formal packages. * sem_res.adb (Resolve_Allocator): Add condition to avoid emitting an error for allocators when the type being allocated is class-wide and from a generic formal package.