This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/23208] Illegal program not detected, RM 12.5.1(15, 28)
- From: "ludovic dot brenta at insalien dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Aug 2005 05:14:51 -0000
- Subject: [Bug ada/23208] Illegal program not detected, RM 12.5.1(15, 28)
- References: <20050802204542.23208.ludovic.brenta@insalien.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From ludovic dot brenta at insalien dot org 2005-08-03 05:14 -------
Yes, I was mistaken: RM 3.3(23) says: "A subtype is an indefinite subtype if it
is an unconstrained array subtype, or if it has unknown discriminants or
unconstrained discriminants without defaults, otherwise the subtype is a
definite subtype". Therefore, R is a definite subtype since it has known
discriminants. In contrast:
procedure Test_12_5_1 is
generic
type T is private;
package P is
end P;
package Q is
type R (<>) is private;
private
type R (B : Boolean := True) is record
case B is
when True => Component : Integer;
when False => null;
end case;
end record;
end Q;
package PP is new P (T => Q.R);
begin
null;
end Test_12_5_1;
Here, Q.R is indefinite and GNAT correcly diagnoses the problem:
test_12_5_1.adb:18:31: actual for "T" must be a definite subtype
gnatmake: "test_12_5_1.adb" compilation error
Marking this bug as INVALID (i.e. not a bug).
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23208