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: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Weird error with Dynamic_Predicate Date: Mon, 12 May 2014 17:17:46 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <3f9e21b4-868d-44de-9673-824eefb9e79e@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1399933066 14551 69.95.181.76 (12 May 2014 22:17:46 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 12 May 2014 22:17:46 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Original-Bytes: 2270 Xref: number.nntp.dca.giganews.com comp.lang.ada:186373 Date: 2014-05-12T17:17:46-05:00 List-Id: "Adam Beneschan" wrote in message news:3f9e21b4-868d-44de-9673-824eefb9e79e@googlegroups.com... > For what it's worth, here's the smallest reduced example I can come up > with that gives the same error message: > > package Prova is > type Identifier_Name is new String with Dynamic_Predicate => true; > function Extract_Namespace (Nome : Identifier_Name) > return Identifier_Name; > end Prova; > > package body Prova is > function Extract_Namespace (Nome : Identifier_Name) > return Identifier_Name > is > Idx : Natural := Ada.Strings.Fixed.Index (String (Nome), "."); > begin > return "ns"; > end Extract_Namespace; > end Prova; > > This is with GCC 4.5.4 (20120510). The package body is missing a context clause of Ada.Strings.Fixed. With that corrected, it works with the GNAT I'm using for ACATS testing. Similarly, the OP's code sample compiles without errors with that GNAT. Ergo, this is a GNAT bug that's been fixed sometime in the past two years. The OP needs a compiler upgrade (whether its available at this time is an unknown question). Randy.