From: Eric Botcazou Date: Wed, 10 Sep 2025 12:31:47 +0000 (+0200) Subject: ada: Make error recovery for structural generic instantiation more robust X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d0480803651f2765c21c2b1082a5d8078187740;p=thirdparty%2Fgcc.git ada: Make error recovery for structural generic instantiation more robust This adds a guard for the case of a selected component whose prefix is an illegal structural generic instance. gcc/ada/ChangeLog: * sem_ch4.adb (Analyze_Selected_Component): Bail out if the prefix has Void_Type. --- diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index b0abfe4bb6b..61a53f56a98 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -5449,6 +5449,10 @@ package body Sem_Ch4 is else Prefix_Type := Etype (Pref); + if Prefix_Type = Standard_Void_Type then + pragma Assert (Serious_Errors_Detected > 0); + return; + end if; end if; if Is_Access_Type (Prefix_Type) then