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.140.232.148 with SMTP id d142mr9795182qhc.4.1447274432987; Wed, 11 Nov 2015 12:40:32 -0800 (PST) X-Received: by 10.182.50.225 with SMTP id f1mr117330obo.11.1447274432939; Wed, 11 Nov 2015 12:40:32 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.mixmin.net!enother.net!enother.net!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!b51no22877qgf.0!news-out.google.com!f6ni1382igq.0!nntp.google.com!i2no1964831igv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 11 Nov 2015 12:40:32 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.55.220.94; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 91.55.220.94 References: <7ba56b33-28d4-42d2-8b9b-5ad9f5beab8b@googlegroups.com> <87io597447.fsf@theworld.com> <66278720-249a-4191-a908-bb840e7f3ccc@googlegroups.com> <6d874e75-e2c9-47e9-b394-f04052f10aa3@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1a532527-f48c-4646-abb5-ec64b5e6106b@googlegroups.com> Subject: Re: Bounded String question From: AdaMagica Injection-Date: Wed, 11 Nov 2015 20:40:32 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 2710 X-Received-Body-CRC: 4275249239 Xref: news.eternal-september.org comp.lang.ada:28311 Date: 2015-11-11T12:40:32-08:00 List-Id: Am Mittwoch, 11. November 2015 21:32:39 UTC+1 schrieb Serge Robyns: > This how this whole thread started. That construct does not work > with pragma preelaborate. But this was exactly the code I had initially :-) No complaint from GNAT GPL 2015: -------------------------------- with Ada.Strings; use Ada.Strings; with Ada.Strings.Bounded; procedure BS_Test is pragma Preelaborate; package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (20); type OS is new BS.Bounded_String; No_OS: constant OS := OS (BS.Null_Bounded_String); -- renaming does not work here, only allowed for tagged types function To_OS (Source: in String; Drop : in Truncation := Error) return OS renames BS_Test.To_Bounded_String; -- inherited operations are implicitly defined in the same declarative region as the derived type B: OS := To_OS ("asdfghjkl"); S: String := To_String (B); begin -- BS_Test null; end BS_Test; gprbuild -ws -c -f -u -PC:\Users\Grein\Documents\Christoph\Ada\Spielplatz\spielplatz.gpr -XGeneration=Ada_2012 bs_test.adb gcc -c -gnato -g -fstack-check -gnata -gnatf -gnat12 bs_test.adb [2015-11-11 21:37:27] process terminated successfully, elapsed time: 02.07s