https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38330

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |17.0
         Resolution|---                         |FIXED

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <[email protected]>:

https://gcc.gnu.org/g:152e0cc2130c686846094cd742ade5c333a56bde

commit r17-5430-g152e0cc2130c686846094cd742ade5c333a56bde
Author: Eric Botcazou <[email protected]>
Date:   Wed Oct 21 11:24:26 2026 +0200

    Ada: Small tweaks related to illegal constructs

    This deals with 3 very old reports about illegal constructs being silently
    accepted by the compiler, in two different ways:

    PR ada/18762: the compiler accepts the renaming of an inherited subprogram
    of a derived untagged type, because it sets the convention Ada instead of
    Intrinsic on the subprogram.

    PR ada/31417: the compiler accepts nonstatic constraints for discriminants
    of the ancestor part of private extensions, whereas only statically
matching
    ones are legal, because it checks only the full conformance of constraints.

    PR ada/38330: the compiler accepts simple aggregates for the extension of a
    formal tagged private type, whereas only extension aggregates are legal.

    The first 2 cases are benign and cannot be rejected without breaking
working
    code, so the tweaks are mostly made to the commentary for them; the latter
    case is more problematic and, therefore, is fully fixed.

    gcc/ada/
            PR ada/18762
            PR ada/31417
            PR ada/38330
            * sem_ch3.adb (Build_Derived_Record_Type): Set Has_Private_Ancestor
            on the extension of a formal tagged private type.  Implement the RM
            7.3(13) subclause consistently independently of whether the derived
            type itself is declared with discriminants.
            (Derive_Subprogram): Document the implementation of RM 6.3.1(7).
            (Process_Full_View): Remove obsolete comment about RM 7.3(13).

    gcc/testsuite/
            * gnat.dg/specs/private4.ads: New test.

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Fixed on the mainline.

Reply via email to