]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Reject structural instantiation in generic formal part
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 25 May 2026 20:40:20 +0000 (22:40 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 5 Jun 2026 07:28:59 +0000 (09:28 +0200)
commit4b6b4e9d3bde8ea71d65a4ae83ac522c8396b919
tree4f36c804a17d289dc8e0f5cecfdaba03e7c653ea
parent218780d6c7b93cec4d7088079820491b6b8f2771
ada: Reject structural instantiation in generic formal part

The structural instance would amount to a formal package in this context,
and that's totally unsupported by the current implementation.

gcc/ada/ChangeLog:

* sem_ch3.adb (Analyze_Private_Extension_Declaration): Be prepared
for Find_Type_Of_Subtype_Indic returning no type.
* sem_ch4.adb (Process_Generic_Instantiation): Give an error if the
generic instantation is referenced in a generic formal part.
* sem_ch12.adb (Analyze_Formal_Derived_Type): Return early in every
case of serious errors.
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch3.adb
gcc/ada/sem_ch4.adb