Bug 21490 - Illegal program not detected, RM 3.6(11)
Summary: Illegal program not detected, RM 3.6(11)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2005-05-10 13:37 UTC by Ludovic Brenta
Modified: 2009-07-19 14:37 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.1.0
Last reconfirmed: 2005-06-20 03:43:54


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ludovic Brenta 2005-05-10 13:37:12 UTC
(From the Debian BTS):

procedure Test_306835 is
   generic
      type T1 is private;
   package pak1 is
      type T2 is array(1..10) of aliased T1;
   end pak1;

   type T3 (b: Boolean := False) is null record;
   package new_pak1 is new pak1 (T1 => T3);  --ERROR: T3 unconstrained
begin
   null;
end Test_306835;


the compiler says nothing when it should detect the error.

-- 
Ludovic Brenta.
Comment 1 Andrew Pinski 2005-06-20 03:43:54 UTC
Confirmed.
Comment 2 Arnaud Charlet 2009-07-19 14:37:18 UTC
This is now handled properly (has been for a long time actually).
In Ada 95 mode, the code is rejected:

test_306835.adb:9:04: instantiation error at line 5
test_306835.adb:9:04: aliased component type must be constrained (RM 3.6(11))

and in Ada 2005 mode (the default) the code is accepted, as per AI 363