https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127466
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ebotcazou at gcc dot gnu.org
Target Milestone|--- |16.2
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
Summary|[ada] GNAT rejects legal |Incorrect derivation of
|Unchecked_Union |unchecked union type
|derived-type discriminant |
|access with "sorry - unable |
|to generate discriminant |
|check" (regression from |
|GNAT 12) |
--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Whether the discriminant is inferable is irrelevant; the compiler should not
try to emit a discriminant check for an unchecked union in the first place.
But the regression is only apparent, since the derivation was incorrect with
GCC 12 and earlier compilers (the Unchecked_Union aspect was incorrectly lost),
so it's actually a minor progress. In any case, this is fixed in 16.2 and
later.