From: Viljar Indus Date: Tue, 7 Oct 2025 09:59:28 +0000 (+0300) Subject: ada: Avoid triggering ghost context errors on prefixed names X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a740ac2bf812a0a08410e549ffbeeb032bf31478;p=thirdparty%2Fgcc.git ada: Avoid triggering ghost context errors on prefixed names Errors for ghost incompatibilities of qualified names should not be applied to prefixes but rather only the final selector. gcc/ada/ChangeLog: * ghost.adb (Is_Ok_Context): consider ghost prefix to always be a valid ghost context. --- diff --git a/gcc/ada/ghost.adb b/gcc/ada/ghost.adb index e7a55efb4be..d49d94df246 100644 --- a/gcc/ada/ghost.adb +++ b/gcc/ada/ghost.adb @@ -740,6 +740,14 @@ package body Ghost is then return True; + -- It is always legal to use a ghost prefix. More complex + -- scenarios are analyzed for the selector. + + elsif Nkind (Par) = N_Selected_Component + and then Prefix (Par) = Prev + then + return True; + elsif Is_OK_Declaration (Par) then return True;