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

            Bug ID: 123666
           Summary: Legal Instantiation of Parent Package within Child's
                    body Disallowed by GNAT
           Product: gcc
           Version: 15.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: efmavourneen at axioaction dot org
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

Created attachment 63379
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63379&action=edit
generic spec Parent, generic spec Child, body Child

An instantiation of a child package's generic parent within the child's body is
disallowed by GNAT with the error: 'instantiation of "Parent" within itself'.

The 2022 Ada LRM has an implied rule against instantiating a generic parent
package (P) within the declarative region of the child package (C).  There is
no such rule or implication that I can find that disallows the instantiation
within C's body.  There is no circularity.
  • [Bug ada/123666] New: Lega... efmavourneen at axioaction dot org via Gcc-bugs

Reply via email to