Bug 15840 - Illegal program not detected, RM 3.7(14)
Summary: Illegal program not detected, RM 3.7(14)
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2004-06-06 10:14 UTC by Ludovic Brenta
Modified: 2015-12-05 10:11 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.0.0, 4.3.0, 4.4.1
Last reconfirmed: 2007-12-13 14:05:37


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ludovic Brenta 2004-06-06 10:14:44 UTC
-- RM95 3.7(14)
-- If the parent type is not a tagged type, then each
-- discriminant of the derived type shall be used in
-- the constraint defining the parent subtype;
generic
   type T1 is private;
package Test_247013 is
   type T2 (x: integer) is new T1;  -- ERROR: x not used
end Test_247013;


I expect an error message like this:
test_247013.ads:8:11: Discriminant "x" is not used to constrain the parent
subtype "T1" (RM 3.7(14))

But the compiler says nothing
Comment 1 Andrew Pinski 2004-10-29 14:45:08 UTC
Confirmed.
Comment 2 Samuel Tardieu 2007-12-13 14:05:37 UTC
Confirmed on 4.3.0 20071213
Comment 3 Ludovic Brenta 2009-08-06 20:43:19 UTC
Confirmed on 4.4.1.
Comment 4 Nicolas Boulenguez 2011-08-31 00:52:48 UTC
confirmed 4.6.1
Comment 5 Nicolas Boulenguez 2014-02-27 14:31:45 UTC
confirm 4.9-20140218
Comment 6 Eric Botcazou 2015-12-05 10:11:07 UTC
The error is reported on the instantiation.