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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border2.nntp.dca.giganews.com!nntp.giganews.com!news.bbs-scene.org!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Freezing query Date: Thu, 30 Jan 2014 21:49:26 +0000 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="f4c34a0d1a0b50d7528d4047756bbea8"; logging-data="10333"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18q5z2vl2ibrJAVmcJ7AmGQOnsWGGOib6Y=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:GDfxrM4QoU7vKGP3JdfinZ1LCew= sha1:5Lcy09zWVWZXVLhUYBXmXF4ucMQ= Xref: number.nntp.dca.giganews.com comp.lang.ada:184613 Date: 2014-01-30T21:49:26+00:00 List-Id: A question[1] on StackOverflow thinks that given type U is tagged private; type W is new U with private; type X is new W with private; procedure M1 (P1 : U; P2 : in out U; P3 : Integer); procedure M2 (P1 : Float ; P2 : in out U); procedure M2 (P1 : Float ; P2 : Boolean ; P3 : in out W); the three operations are primitive. GNAT doesn't treat them as primitive unless you re-order so that the subprograms come immediately after the type concerned: type U is tagged private; procedure M1 (P1 : U; P2 : in out U; P3 : Integer); procedure M2 (P1 : Float ; P2 : in out U); type W is new U with private; procedure M2 (P1 : Float ; P2 : Boolean ; P3 : in out W); type X is new W with private; This seems reasonable given ARM 13.14(7)[2], but then AARM 13.14(7.b)[3] says that "The declaration of a private extension does not cause freezing.". You'd have thought that (7.b) ought not to be relegated to the Annotated manual! Is GNAT's behaviour a bug? [1] http://stackoverflow.com/questions/21447636/ada-derived-types-and-primitive-operation [2] http://www.ada-auth.org/standards/12rm/html/RM-13-14.html#p7 [3] http://www.ada-auth.org/standards/12aarm/html/AA-13-14.html#p7.b