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

            Bug ID: 62122
           Summary: GNAT RM: flaw in example of @node Attribute
                    Unrestricted_Access
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: georggcc at googlemail dot com

The example illustrating 'Unrestricted_Access for subprograms
declares a type access procedure with null exclusion, named
Less_Nested, in the body of a package P.

It then declares an object of this (pointer) type, albeit without
initializing it, named Global, in the same package body.
Consequently, since there is a null exclusion, elaboration
of the declaration of Global raises Constraint_Error.

Therefore, neither of the two procedures P1 and P2 illustrating
the use of 'Unrestricted_Access can ever be called, thus defeating
the purpose.

One possible fix is to remove the null exclusion from
the definition of type Less_Nested.

(gcc/ada/gnat_rm.texi SVN r213591, $(srcdir)/BASE-VER has 4.10.0)

Reply via email to