Bug 15840

Summary: Illegal program not detected, RM 3.7(14)
Product: gcc Reporter: Ludovic Brenta <ludovic>
Component: adaAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED WORKSFORME    
Severity: normal CC: ebotcazou, gcc-bugs, nicolas, sam
Priority: P2 Keywords: accepts-invalid
Version: 3.4.0   
Target Milestone: ---   
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

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.