CVS difference for acats/b4/b490001.a
--- acats/b4/b490001.a 1999/03/11 00:26:30 1.3
+++ acats/b4/b490001.a 2014/03/13 05:55:46 1.4
@@ -4,8 +4,8 @@
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687 and
-- F08630-91-C-0015, the U.S. Government obtained unlimited rights in the
--- tation contained herein. Unlimited rights are
--- 227-7013(a)(19). By making this public release,
+-- software and documentation contained herein. Unlimited rights are
+-- defined in DFAR 252.227-7013(a)(19). By making this public release,
-- the Government intends to confer upon all recipients unlimited rights
-- equal to those held by the Government. These rights include rights to
-- use, duplicate, release or disclose the released technical data and
@@ -15,9 +15,9 @@
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--- THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
+-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--- ION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
+-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
@@ -64,9 +64,9 @@
--
-- In most cases the entity being tested is first used to initialize a
-- constant, and the constant is then used in a context requiring a
--- i.e, a static constant, LM 4.9(24);6.0. The
--- stant in such a context depends on it being
--- which in turn depends on the entity being tested
+-- static expression, i.e, a static constant, LM 4.9(24);6.0. The
+-- legality of the constant in such a context depends on it being
+-- considered static, which in turn depends on the entity being tested
-- being considered static.
--
-- The entities above tested in various combinations, such that the
@@ -95,6 +95,7 @@
-- 06 Oct 96 SAIC Added LM references; Deleted IntCnt case.
-- 24 Feb 97 PWB.CTA Corrected static expression that raised exception.
-- 30 Sep 98 EDS Corrected Type Conversions.
+-- 10 Mar 14 RLB Corrected Ada 2012 syntax errors.
--!
generic
@@ -103,9 +104,9 @@
-- In the declaration of Variant1 below, the numeric literal 0 in the first
-- discrete choice is static, even though its expected type (Formal_Scalar)
- -- is not. The discrete choice is therefore legal:
+ -- is not. The discrete choice is therefore legal:
- type Variant1 (Choice : Formal_Scalar) is record
+ type Variant1 (Choice : Formal_Scalar) is record
case Choice is
-- A discrete choice must be static. -- RM 3.8.1(8);6.0
when 0 => -- (a) -- OK.
@@ -125,14 +126,14 @@
PosMax : constant Positive := Positive(Max); -- Static constant.
-- The simple expressions in the range of an integer type definition must
- -- be static.
+ -- be static.
type My_Int is range 1 .. PosMax; -- (d) -- OK.
- subtype Non_Static_Subtype is Integer
+ subtype Non_Static_Subtype is Integer
range 0 .. Integer (Formal_Scalar'Last);
- Non_Static_Constant : constant Non_Static_Subtype
+ Non_Static_Constant : constant Non_Static_Subtype
:= Non_Static_Subtype (Max);
type My_Type is range 1 .. Non_Static_Constant; -- ERROR:
@@ -142,13 +143,13 @@
-- Since PosMax is a static constant, the subtype Str5 below is static,
-- as is the subtype Str4. In the declaration of Str, the subtype is static,
-- as is the string literal, so Str is a static constant. In the declaration
- -- of Not_True, the subtype mark of the membership test (Str4) is static,
- -- as is the simple expression (Str), so the membership test is static,
- -- which in turn means that Not_True is a static constant. Not_True is
- -- therefore legal as a discrete choice in the declaration of Variant2. The
- -- other discrete choice ("Hello" in Str5) is also legal, since the string
- -- literal and the subtype mark (and therefore the membership test) are
- -- static:
+ -- of Not_True, the subtype mark of the membership test (Str4) is static,
+ -- as is the simple expression (Str), so the membership test is static,
+ -- which in turn means that Not_True is a static constant. Not_True is
+ -- therefore legal as a discrete choice in the declaration of Variant2. The
+ -- other discrete choice ("Hello" in Str5) is also legal, since the string
+ -- literal and the subtype mark (and therefore the membership test) are
+ -- static:
subtype Str4 is String (1 .. 4); -- Static string subtype.
subtype Str5 is String (1 .. PosMax); -- Static string subtype.
@@ -159,9 +160,9 @@
type Variant2 (Choice : Boolean) is record
case Choice is
- when "Hello" in Str5 => -- (b) (d) (e) -- OK.
+ when ("Hello" in Str5) => -- (b) (d) (e) -- OK.
A : Integer;
- when Not_True => -- (b) (e) -- OK.
+ when Not_True => -- (b) (e) -- OK.
B : Float;
end case;
end record;
@@ -182,7 +183,7 @@
type Variant3 (Choice: Boolean) is record
case Choice is
- when Positive(Max) in Str'Range => -- (d) (e) -- OK.
+ when (Positive(Max) in Str'Range) => -- (d) (e) -- OK.
A : Integer;
when Untrue => -- (b) (e) -- OK.
B : Float;
@@ -217,10 +218,10 @@
Bool2 : constant Boolean :=
(The_Length > 5) or else (The_First < 1); -- Static constant.
-
+
Bool3 : constant Boolean :=
(3 in Str4'Range) and then (The_First = 1); -- Static constant.
-
+
-- Number declarations require static expressions. RM 3.3.2(4);6.0.
Num1 : constant := Boolean'Pos(Bool1); -- (f) -- OK.
@@ -272,7 +273,7 @@
Mod_Value : Modular_Type := Modular_Type'Modulus; -- ERROR:
-- Static expression fails Range_Check.
-
+
High_Mod : Modular_Type := (Modular_Type'Modulus - 1); -- ERROR:
-- Static expression fails Range_Check.
@@ -328,7 +329,7 @@
Start_Fraction : constant My_Int := My_Int(1/Scale'Last); -- OK.
- End_Fraction : constant My_Int := 1/My_Int(Scale'First); -- ERROR:
+ End_Fraction : constant My_Int := 1/My_Int(Scale'First); -- ERROR:
-- Static expression fails Division_Check.
@@ -378,5 +379,5 @@
How_Many := FixLast - FixFirst; -- ERROR:
-- Static expression outside base range of expected type.
-
+
end B490001;
Questions? Ask the ACAA Technical Agent