From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.136.71 with SMTP id py7mr4261197pab.35.1408041470158; Thu, 14 Aug 2014 11:37:50 -0700 (PDT) X-Received: by 10.182.19.138 with SMTP id f10mr835obe.42.1408041469895; Thu, 14 Aug 2014 11:37:49 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!h18no20317325igc.0!news-out.google.com!px9ni588igc.0!nntp.google.com!h18no20317311igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 14 Aug 2014 11:37:49 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: "use" after "limited with" (GNAT bug?) From: Adam Beneschan Injection-Date: Thu, 14 Aug 2014 18:37:50 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:21770 Date: 2014-08-14T11:37:49-07:00 List-Id: On Thursday, August 14, 2014 11:08:47 AM UTC-7, Victor Porton wrote: > -- p1.ads >=20 > package P1 is >=20 > end P1; >=20 > -- p2.ads >=20 > limited with P1; > use P1; >=20 > package P2 is >=20 > end P2; >=20 >=20 >=20 > $ gnatmake -q -c -gnatc -u -P/home/porton/t/p/default.gpr p2.ads > p2.ads:2:05: "P1" is undefined > gnatmake: "/home/porton/t/p/p2.ads" compilation error >=20 > Why "use" does not work? Is it a bug of gnatgcc (Debian 4.9.1-4) 4.9.1? It's illegal. You just can't USE a LIMITED WITH'ed package. RM 10.1.2, paragraphs 19, 22: A limited_with_clause that names a library package shall not appear: within a context_clause for a library_item that is within the scope of a us= e_clause that names an entity declared within the declarative region of the= library package. >From the AARM: Reason: This prevents visibility issues, where whether an entity is an inco= mplete or full view depends on how the name of the entity is written. The l= imited_with_clause cannot be useful, as we must have the full view availabl= e in the parent in order for the use_clause to be legal.=20 -- Adam