This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/38330] New: Illegal program not detected, RM 4.3.1(16/2)
- From: "ludovic at ludovic-brenta dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Nov 2008 14:49:57 -0000
- Subject: [Bug ada/38330] New: Illegal program not detected, RM 4.3.1(16/2)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
generic
type T1 is tagged private;
package pak1 is
type T2 is new T1 with
record
i,j: integer;
end record;
x1: T2 := T2'(2,3); -- ERROR:
x2: T2 := T2'(T1 with 2,3); -- OK
end pak1;
The declaration of x1 is illegal because the record_aggregate does not include
all components of x1, violating 4.3.1(16/2). In this particular case, since
the components inherited from T1 are unknown, the only legal kind of aggregate
is a record_extension_aggregate, as done for x2.
The compiler accepts this illegal program.
--
Summary: Illegal program not detected, RM 4.3.1(16/2)
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ludovic at ludovic-brenta dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38330