comp.lang.ada
 help / color / mirror / Atom feed
From: Xavier Petit <xpetit@becoast.fr>
Subject: Re: Predicate and value attribute
Date: Tue, 26 Jan 2016 12:09:04 +0100
Date: 2016-01-26T12:09:04+01:00	[thread overview]
Message-ID: <56a753d0$0$3059$426a34cc@news.free.fr> (raw)
In-Reply-To: <ecf9f205-b5ed-464f-9c8e-72400f412957@googlegroups.com>

> I suggest you post your code which triggered the error. So, we can use the same reference.
>
> Anh Vo
>

Ok, here the main file is sandbox.adb =>

procedure Sandbox is
    subtype Number is String
      with Dynamic_Predicate => Integer'Value (Number) in -1 .. 5;

    subtype Number2 is String
      with Dynamic_Predicate => Integer'Value (Number2) in -1 | 5;

    function Check_Number3 (Item : String) return Boolean
    is
      (Integer'Value (Item) in -1 .. 5);

    subtype Number3 is String
      with Dynamic_Predicate => Check_Number3 (Number3);

    Test : constant Number := "-1";
    Test2 : constant Number2 := "-1";
    Test3 : constant Number3 := "-1";

begin
    null;
end;


$ gnatmake sandbox.adb
gcc -c sandbox.adb
sandbox.adb:3:39: "Value_Integer" is undefined
compilation abandoned due to previous error
gnatmake: "sandbox.adb" compilation error

$ gnatmake --version
GNATMAKE GPL 2015 (20150428-49)

Adacore GNAT 2015

The subtype "Number" seems to be wrong whereas "Number2" and "Number3" 
are valid.

-- 
Xavier Petit


  reply	other threads:[~2016-01-26 11:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-23 11:16 Predicate and value attribute Xavier Petit
2016-01-24 11:38 ` AdaMagica
2016-01-25  8:28 ` Jacob Sparre Andersen
2016-01-25 14:52 ` Xavier Petit
2016-01-26  0:28   ` Anh Vo
2016-01-26 11:09     ` Xavier Petit [this message]
2016-01-26 18:06       ` Jeffrey R. Carter
2016-01-26 20:41         ` Anh Vo
2016-01-26 20:43       ` Simon Wright
2016-01-27 22:02         ` Xavier Petit
2016-01-28  7:56           ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox