1-- CC51008.A 2-- 3-- Grant of Unlimited Rights 4-- 5-- The Ada Conformity Assessment Authority (ACAA) holds unlimited 6-- rights in the software and documentation contained herein. Unlimited 7-- rights are the same as those granted by the U.S. Government for older 8-- parts of the Ada Conformity Assessment Test Suite, and are defined 9-- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA 10-- intends to confer upon all recipients unlimited rights equal to those 11-- held by the ACAA. These rights include rights to use, duplicate, 12-- release or disclose the released technical data and computer software 13-- in whole or in part, in any manner and for any purpose whatsoever, and 14-- to have or permit others to do so. 15-- 16-- DISCLAIMER 17-- 18-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR 19-- DISCLOSED ARE AS IS. THE ACAA MAKES NO EXPRESS OR IMPLIED 20-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE 21-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE 22-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A 23-- PARTICULAR PURPOSE OF SAID MATERIAL. 24--* 25-- 26-- OBJECTIVE: 27-- Check that operations are inherited for a formal derived type whose 28-- ancestor is also a formal type as described in the corrigendum. 29-- (Defect Report 8652/0038, as reflected in Technical Corrigendum 1, 30-- RM95 12.5.1(21/1)). 31-- 32-- CHANGE HISTORY: 33-- 29 Jan 2001 PHL Initial version. 34-- 30 Apr 2002 RLB Readied for release. 35-- 36--! 37package CC51008_0 is 38 39 type R0 is 40 record 41 C : Float; 42 end record; 43 44 procedure S (X : R0); 45 46end CC51008_0; 47 48with Report; 49use Report; 50package body CC51008_0 is 51 procedure S (X : R0) is 52 begin 53 Comment ("CC51008_0.S called"); 54 end S; 55end CC51008_0; 56 57with CC51008_0; 58generic 59 type F1 is new CC51008_0.R0; 60 type F2 is new F1; 61package CC51008_1 is 62 procedure G (O1 : F1; O2 : F2); 63end CC51008_1; 64 65package body CC51008_1 is 66 procedure G (O1 : F1; O2 : F2) is 67 begin 68 S (O1); 69 S (O2); 70 end G; 71end CC51008_1; 72 73with CC51008_0; 74package CC51008_2 is 75 type R2 is new CC51008_0.R0; 76 procedure S (X : out R2); 77end CC51008_2; 78 79with Report; 80use Report; 81package body CC51008_2 is 82 procedure S (X : out R2) is 83 begin 84 Failed ("CC51008_2.S called"); 85 end S; 86end CC51008_2; 87 88with CC51008_2; 89package CC51008_3 is 90 type R3 is new CC51008_2.R2; 91 procedure S (X : R3); 92end CC51008_3; 93 94with Report; 95use Report; 96package body CC51008_3 is 97 procedure S (X : R3) is 98 begin 99 Failed ("CC51008_3.S called"); 100 end S; 101end CC51008_3; 102 103with CC51008_1; 104with CC51008_2; 105with CC51008_3; 106with Report; 107use Report; 108procedure CC51008 is 109 110 package Inst is new CC51008_1 (CC51008_2.R2, 111 CC51008_3.R3); 112 113 X2 : constant CC51008_2.R2 := (C => 2.0); 114 X3 : constant CC51008_3.R3 := (C => 3.0); 115 116begin 117 Test ("CC51008", 118 "Check that operations are inherited for a formal derived " & 119 "type whose ancestor is also a formal type as described in " & 120 "RM95 12.5.1(21/1)"); 121 Inst.G (X2, X3); 122 Result; 123end CC51008; 124 125