* Gnat error msg meaning?
@ 2002-12-26 23:22 tmoran
2002-12-27 20:04 ` Simon Wright
0 siblings, 1 reply; 4+ messages in thread
From: tmoran @ 2002-12-26 23:22 UTC (permalink / raw)
Perhaps I haven't recovered from the eggnog yet, but why does Gnat give
an error message, what does it mean, and what should I do?
unique_str.ads:11:23: Only static constraints allowed for parent
discriminants in the partial view
relevant source:
package root is
type String_Counts is range 0 .. 50_000;
type String_Character_Counts is range 0 .. 100_000_000;
type Store_Type(Max_Strings : String_Counts;
Max_Characters : String_Character_Counts;
Task_Safe : Boolean)
is new Ada.Finalization.Controlled with private;
...
package unique_str is
type Store_Type(Max_Strings : root.String_Counts;
Max_Characters : root.String_Character_Counts;
Task_Safe : Boolean;
Comparison : Comparison_Map_Ptr)
is new root.Store_Type(Max_Strings, Max_Characters, Task_Safe)
-- ^ error location
with private;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Gnat error msg meaning?
2002-12-26 23:22 tmoran
@ 2002-12-27 20:04 ` Simon Wright
2002-12-27 20:46 ` tmoran
0 siblings, 1 reply; 4+ messages in thread
From: Simon Wright @ 2002-12-27 20:04 UTC (permalink / raw)
tmoran@acm.org writes:
> package unique_str is
> type Store_Type(Max_Strings : root.String_Counts;
> Max_Characters : root.String_Character_Counts;
> Task_Safe : Boolean;
> Comparison : Comparison_Map_Ptr)
> is new root.Store_Type(Max_Strings, Max_Characters, Task_Safe)
is new root.Store_Type
> with private;
compiles OK with GCC 3.2.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Gnat error msg meaning?
2002-12-27 20:04 ` Simon Wright
@ 2002-12-27 20:46 ` tmoran
0 siblings, 0 replies; 4+ messages in thread
From: tmoran @ 2002-12-27 20:46 UTC (permalink / raw)
> > is new root.Store_Type(Max_Strings, Max_Characters, Task_Safe)
>
> is new root.Store_Type
>
> > with private;
>
> compiles OK with GCC 3.2.
Interesting. Dropping mention of the parent's constraints until the
full, private, declaration, does seem to solve the problem with Gnat. One
of the other compilers doesn't seem to care either way, but the third one
points out RM 3.7(13) "The parent subtype shall be constrained;". Who's
right?
In the meantime, sounds like I need two different versions of this
spec for two different compilers. :(
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-12-27 20:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bbegua.m94.ln@beastie.ix.netcom.com>
2002-12-27 4:59 ` Gnat error msg meaning? tmoran
2002-12-26 23:22 tmoran
2002-12-27 20:04 ` Simon Wright
2002-12-27 20:46 ` tmoran
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox