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,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,df055ffdd469757d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.102.69 with SMTP id fm5mr2563889wib.0.1361153354904; Sun, 17 Feb 2013 18:09:14 -0800 (PST) Path: g1ni17491wig.0!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.103.MISMATCH!feeder3.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.138.MISMATCH!xlned.com!feeder5.xlned.com!news.astraweb.com!border5.a.newsrouter.astraweb.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!news.nobody.at!texta.sil.at!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Fri, 15 Feb 2013 11:15:13 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Class wide preconditions: error in GNAT implementation? References: In-Reply-To: Message-ID: <511e0aae$0$9525$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 15 Feb 2013 11:15:10 CET NNTP-Posting-Host: a38a866b.newsspool1.arcor-online.net X-Trace: DXC=HE_hBfT89BUHigV@eW57PQic==]BZ:af^4Fo<]lROoRQnkgeX?EC@@P@eiPY3A=egUPCY\c7>ejVXGhX4cg:7Vb023S X-Complaints-To: usenet-abuse@arcor.de Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2013-02-15T11:15:10+01:00 List-Id: On 15.02.13 04:55, ytomino wrote: > See below example: This yields an ICE for me: gcc -c -gnata -gnat2012 -gnatd.n -gnatG -gnatl preconds.ads /Users/bauhaus/mine/lib/gcc/x86_64-apple-darwin11.4.2/4.8.0/adainclude/system.ads GNAT 4.8.0 20130212 (experimental) [trunk revision 195968] Copyright 1992-2013, Free Software Foundation, Inc. preconds.ads /Users/bauhaus/mine/lib/gcc/x86_64-apple-darwin11.4.2/4.8.0/adainclude/a-tags.ads /Users/bauhaus/mine/lib/gcc/x86_64-apple-darwin11.4.2/4.8.0/adainclude/ada.ads /Users/bauhaus/mine/lib/gcc/x86_64-apple-darwin11.4.2/4.8.0/adainclude/s-stoele.ads /Users/bauhaus/mine/lib/gcc/x86_64-apple-darwin11.4.2/4.8.0/adainclude/s-stoele.adb /Users/bauhaus/mine/lib/gcc/x86_64-apple-darwin11.4.2/4.8.0/adainclude/a-unccon.ads /Users/bauhaus/mine/lib/gcc/x86_64-apple-darwin11.4.2/4.8.0/adainclude/s-stalib.ads /Users/bauhaus/mine/lib/gcc/x86_64-apple-darwin11.4.2/4.8.0/adainclude/s-exctab.ads +===========================GNAT BUG DETECTED==============================+ | 4.8.0 20130212 (experimental) [trunk revision 195968] (x86_64-apple-darwin11.4.2) | | Assert_Failure atree.adb:903 | | Error detected at preconds.ads:5:4 | | Please submit a bug report; see http://gcc.gnu.org/bugs.html. | | Use a subject line meaningful to you and us to track the bug. | | Include the entire contents of this bug box in the report. | | Include the exact gcc or gnatmake command that you entered. | | Also include sources listed below in gnatchop format | | (concatenated together with no headers between files). | +==========================================================================+ Please include these source files with error report Note that list may not be accurate in some cases, so please double check that the problem can still be reproduced with the set of files listed. Consider also -gnatd.n switch (see debug.adb). preconds.ads Source recreated from tree for preconds (spec) ---------------------------------------------- with ada.tags; package preconds is package tools is function write_in_expr (s : string) return boolean; end tools; package as is type a is tagged null record; procedure foo (object : a) with pre'Class => tools.write_in_expr ("A, in!"), post'Class => tools.write_in_expr ("A, out!"); pragma postcondition (check => tools.write_in_expr ("A, out!"), message => "failed postcondition from preconds.ads:9"); pragma precondition (check => tools.write_in_expr ("A, in!"), message => "failed precondition from preconds.ads:8"); end as; package bs is type b is new as.a with null record; procedure foo (object : b) with pre'Class => tools.write_in_expr ("B, in!"), post'Class => tools.write_in_expr ("B, out!"); end bs; end preconds; Compiling: preconds.ads (source file time stamp: 2013-02-15 10:13:22) 1. package preconds is 2. package Tools is 3. function Write_In_Expr (S : String) return Boolean; -- Put_Line (S) and return True 4. end Tools; 5. package As is 6. type A is tagged null record; 7. procedure foo (Object : A) -- empty body 8. with Pre'Class => Tools.Write_In_Expr ("A, in!"), 9. Post'Class => Tools.Write_In_Expr ("A, out!"); 10. end As; 11. package Bs is 12. type B is new As.A with null record; 13. overriding procedure foo (Object : B) -- empty body 14. with Pre'Class => Tools.Write_In_Expr ("B, in!"), -- [*] 15. Post'Class => Tools.Write_In_Expr ("B, out!"); 16. end Bs; 17. end preconds; 17 lines: No errors compilation abandoned Source recreated from tree for preconds (spec) ---------------------------------------------- with ada.tags; package preconds is package tools is function write_in_expr (s : string) return boolean; end tools; package as is type a is tagged null record; procedure foo (object : a) with pre'Class => tools.write_in_expr ("A, in!"), post'Class => tools.write_in_expr ("A, out!"); pragma postcondition (check => tools.write_in_expr ("A, out!"), message => "failed postcondition from preconds.ads:9"); pragma precondition (check => tools.write_in_expr ("A, in!"), message => "failed precondition from preconds.ads:8"); end as; package bs is type b is new as.a with null record; procedure foo (object : b) with pre'Class => tools.write_in_expr ("B, in!"), post'Class => tools.write_in_expr ("B, out!"); end bs; end preconds; gnatmake: "preconds.ads" compilation error