CVS difference for acats/b3/b3a2016.a

Differences between 1.2 and version 1.3
Log of other versions for file acats/b3/b3a2016.a

--- acats/b3/b3a2016.a	2007/03/16 03:43:27	1.2
+++ acats/b3/b3a2016.a	2018/02/10 06:13:02	1.3
@@ -80,6 +80,9 @@
 --                          by Tucker.
 --      15 Mar 07   RLB     Replaced test cases based on Amendment wording
 --                          (from AI-235).
+--      09 Feb 18   RLB     Added error location indicators to reflect common
+--                          error reporting strategies.
+--
 --!
 
 package B3A2016 is
@@ -158,12 +161,12 @@
 
    procedure Zip (Val : Access_Proc) is
    begin
-      Val (True); -- OK
+      Val (True);
    end Zip;
 
    procedure Zip (Val : Access_Func) is
    begin
-      if Val (10) then -- OK
+      if Val (10) then
          null;
       end if;
    end Zip;
@@ -195,7 +198,7 @@
 
    function Zep (Val : Access_Func) return Float is
    begin
-      if Val (10) then -- OK
+      if Val (10) then
          return 2.0;
       else
          return 0.0;
@@ -227,19 +230,20 @@
 
    Value : aliased Integer := 4;
 
-   Result1 : Float := Zap (Value'access);  -- OK.
-   Result2 : Float := Zap (Int_Ptr'(Value'access)); -- OK.
+   Result1 : Float := Zap (Value'access);                    -- OK. {23;1}
+   Result2 : Float := Zap (Int_Ptr'(Value'access));          -- OK. {23;1}
 
    Temperature : aliased Float := 98.6;
 
-   Result3 : Float := Zap (Temperature'access);  -- OK.
-   Result4 : Float := Zap (Float_Ptr(Temperature'access)); -- ERROR: Type conv
-   Result5 : Float := Zap (Float_Ptr'(Temperature'access)); -- OK.
+   Result3 : Float := Zap (Temperature'access);              -- OK. {23;1}
+   Result4 : Float := Zap (Float_Ptr(Temperature'access));   -- ERROR: {23;1}
+                                                             -- Type conversion
+   Result5 : Float := Zap (Float_Ptr'(Temperature'access));  -- OK. {23;1}
 
    package body Pkg is
       procedure Call (Action : Access_Proc) is
       begin
-         Action (TRUE); -- OK
+         Action (TRUE);
       end Call;
       function Zop (Val : Float_Ptr) return Float is
       begin
@@ -248,10 +252,11 @@
 
       Humidity : aliased Float := 0.57;
 
-      Result6 : Float := Zop (Humidity'access);  -- OK.
-      Result7 : Float := Zop (Float_Ptr(Humidity'access)); -- ERROR: Type conv
-      Result8 : Float := Zop (Float_Ptr'(Humidity'access)); -- OK.
-      Result9 : Float := Pkg.Zop (Humidity'access); -- OK.
+      Result6 : Float := Zop (Humidity'access);              -- OK. {26;1}
+      Result7 : Float := Zop (Float_Ptr(Humidity'access));   -- ERROR: {26;1}
+                                                             -- Type conversion
+      Result8 : Float := Zop (Float_Ptr'(Humidity'access));  -- OK. {26;1}
+      Result9 : Float := Pkg.Zop (Humidity'access);          -- OK. {26;1}
 
       procedure My_Op (Val : access My_Tagged) is
       begin
@@ -263,72 +268,83 @@
    -- Test that the prefix of 'Unchecked_Access for objects is used
    -- in resolution:
 
-   Result11 : Float := Zap (Value'Unchecked_Access);  -- OK.
+   Result11 : Float := Zap (Value'Unchecked_Access);         -- OK. {24;1}
    Result12 : Float := Zap (Int_Ptr(
-                            Value'Unchecked_Access)); -- ERROR: Type conv
-   Result13 : Float := Zap (Int_Ptr'(Value'Unchecked_Access)); -- OK.
+                            Value'Unchecked_Access));        -- ERROR: {1:24;1}
+                                                             -- Type conversion
+   Result13 : Float := Zap (Int_Ptr'(Value'Unchecked_Access)); -- OK. {24;1}
 
-   Result14 : Float := Zap (Temperature'Unchecked_Access);  -- OK.
+   Result14 : Float := Zap (Temperature'Unchecked_Access);   -- OK. {24;1}
    Result15 : Float := Zap (Float_Ptr(
-                            Temperature'Unchecked_Access)); -- ERROR: Type conv
-   Result16 : Float := Zap (Float_Ptr'(Temperature'Unchecked_Access)); -- OK.
+                            Temperature'Unchecked_Access));  -- ERROR: {1:24;1}
+                                                             -- Type conversion
+   Result16 : Float := Zap (Float_Ptr'(
+                            Temperature'Unchecked_Access));  -- OK. {1:24;1}
 
-   Subprogram : Access_Proc := Set_Flag'access; -- OK.
+   Subprogram : Access_Proc := Set_Flag'access;
 
    -- Check that pool-specific access types participate in resolution of
    -- access attributes:
 
-   Result20 : Float := Zup (Temperature'access);  -- ERROR: Ambiguous
-   Result21 : Float := Zup (Float_Ptr'(Temperature'access)); -- OK.
+   Result20 : Float := Zup (Temperature'access);             -- ERROR: {24;1}
+                                                             -- Ambigious
+   Result21 : Float := Zup (Float_Ptr'(Temperature'access)); -- OK. {24;1}
+
+   Result22 : Float := Zup (Temperature'Unchecked_Access);   -- ERROR: {24;1}
+                                                             -- Ambigious
+   Result23 : Float := Zup (Float_Ptr'(
+                            Temperature'Unchecked_Access));  -- OK. {1:24;1}
 
-   Result22 : Float := Zup (Temperature'Unchecked_Access);  -- ERROR: Ambiguous
-   Result23 : Float := Zup (Float_Ptr'(Temperature'Unchecked_Access)); -- OK.
-
    -- Check that access-to-variable access types participate in resolution of
    -- access attributes, even when the prefix is a constant:
 
    Human_Temperature : aliased constant Float := 98.6;
 
-   Result24 : Float := Zwp (Human_Temperature'access);  -- ERROR: Ambiguous
+   Result24 : Float := Zwp (Human_Temperature'access);       -- ERROR: {24;1}
+                                                             -- Ambigious
    Result25 : Float := Zwp (Constant_Float_Ptr'(
-                            Human_Temperature'access)); -- OK.
+                            Human_Temperature'access));      -- OK. {1:24;1}
 
-   Result26 : Float := Zwp (Human_Temperature'Unchecked_Access);  -- ERROR:
+   Result26 : Float := Zwp (
+                         Human_Temperature'Unchecked_Access);-- ERROR: {1:24;1}
+                                                             -- Ambigious
    Result27 : Float := Zwp (Constant_Float_Ptr'(
-                            Human_Temperature'Unchecked_Access)); -- OK.
+                         Human_Temperature'Unchecked_Access));-- OK. {1:24;1}
 
    -- Check that subprogram access types do not participate in resolution of
    -- object access attributes:
 
-   Result30 : Float := Zep (Temperature'access);  -- OK.
-   Result31 : Float := Zep (Float_Ptr'(Temperature'access)); -- OK.
+   Result30 : Float := Zep (Temperature'access);             -- OK. {24;1}
+   Result31 : Float := Zep (Float_Ptr'(Temperature'access)); -- OK. {24;1}
 
-   Result32 : Float := Zep (
-          Temperature'Unchecked_Access);  -- OK.
-   Result33 : Float := Zep (Float_Ptr'(Temperature'Unchecked_Access)); -- OK.
+   Result32 : Float := Zep (Temperature'Unchecked_Access);   -- OK. {24;1}
+   Result33 : Float := Zep (Float_Ptr'(
+                            Temperature'Unchecked_Access));  -- OK. {1:24;1}
 
    -- Check that overloaded prefixes can be resolved:
 
-   Result40 : Float := Zap (Zyp.all'access); -- OK.
-   Result41 : Float := Zap (Zyp.all'Unchecked_Access); -- OK.
-   Result42 : Float := Zap (Int_Ptr'(Zyp.all'access)); -- OK.
-   Result43 : Float := Zap (Int_Ptr'(Zyp.all'Unchecked_Access)); -- OK.
+   Result40 : Float := Zap (Zyp.all'access);                 -- OK. {24;1}
+   Result41 : Float := Zap (Zyp.all'Unchecked_Access);       -- OK. {24;1}
+   Result42 : Float := Zap (Int_Ptr'(Zyp.all'access));       -- OK. {24;1}
+   Result43 : Float := Zap (Int_Ptr'(Zyp.all'Unchecked_Access)); -- OK. {24;1}
 
 begin
    -- Test that the prefix of 'Access for subprograms is used in
    -- resolution:
 
-   Zip (Set_Flag'access); -- OK.
-   Zip (Access_Proc(Set_Flag'access)); -- ERROR: Type conv
-   Zip (Access_Proc'(Set_Flag'access)); -- OK.
-   Zip (Subprogram); -- OK.
+   Zip (Set_Flag'access);                                    -- OK. {4;1}
+   Zip (Access_Proc(Set_Flag'access));                       -- ERROR: {4;1}
+                                                             -- Type conversion
+   Zip (Access_Proc'(Set_Flag'access));                      -- OK. {4;1}
+   Zip (Subprogram);                                         -- OK. {4;1}
 
 
    -- Check that two types with the same structure do not accidentally
    -- match in a subprogram call:
 
-   Pkg.Call (Subprogram); -- ERROR: Type mismatch
-   Pkg.Call (Set_Flag'access); -- OK
+   Pkg.Call (Subprogram);                                    -- ERROR: {4;1}
+                                                             -- Type mismatch
+   Pkg.Call (Set_Flag'access);                               -- OK. {4;1}
 
    -- Check that overloading caused by use clauses is handled the same
    -- as direct overloading:
@@ -338,10 +354,10 @@
       My_Obj : aliased Pkg.My_Tagged;
       New_Obj : aliased Pkg2.New_Tagged;
    begin
-      My_Op (New_Obj'access);               -- OK.
-      Pkg2.My_Op (New_Obj'access);          -- OK.
-      My_Op (My_Obj'Unchecked_Access);      -- OK.
-      Pkg.My_Op (My_Obj'Unchecked_Access);  -- OK.
+      My_Op (New_Obj'access);                                -- OK. {7;1}
+      Pkg2.My_Op (New_Obj'access);                           -- OK. {7;1}
+      My_Op (My_Obj'Unchecked_Access);                       -- OK. {7;1}
+      Pkg.My_Op (My_Obj'Unchecked_Access);                   -- OK. {7;1}
    end;
 
    -- Check Tucker Taft's overloading example:
@@ -366,10 +382,12 @@
          return null;
       end Func;
    begin
-      Proc (Func.all'access, 2); -- OK, resolves to Access_Proc.
-      Proc (Func.all'Unchecked_Access, 2.0); -- OK, resolves to Int_Ptr.
-      Proc (Access_Proc'(Func.all'access), 2); -- OK.
-      Proc (Int_Ptr'(Func.all'Unchecked_Access), 2.0); -- OK.
+      Proc (Func.all'access, 2);                             -- OK. {7;1}
+            -- Resolves to Access_Proc.
+      Proc (Func.all'Unchecked_Access, 2.0);                 -- OK. {7;1}
+            -- Resolves to Int_Ptr.
+      Proc (Access_Proc'(Func.all'access), 2);               -- OK. {7;1}
+      Proc (Int_Ptr'(Func.all'Unchecked_Access), 2.0);       -- OK. {7;1}
    end;
 
 end B3A2016;

Questions? Ask the ACAA Technical Agent