package pak1 is
type T1(<>) is tagged limited private;
private
type T1(D: integer) is tagged limited null record;
end pak1;
with pak1;
package pak2 is
type T2 is new pak1.T1 with null record; -- ERROR: invalid constraint
x1: T2 := (pak1.T1 with null record); -- line 5
end pak2;
package pak1.pak3 is
type T3 is new pak1.T1 with null record; -- ERROR: invalid constraint
x2: T3 := (pak1.T1 with null record);
end pak1.pak3;
GCC 4.1:
gnatmake -gnat05 pak2
gcc-4.1 -c -gnat05 pak2.ads
+===========================GNAT BUG DETECTED==============================+
| 4.1.3 20070518 (prerelease) (Debian 4.1.2-8) (x86_64-pc-linux-gnu) |
| Assert_Failure einfo.adb:813 |
| Error detected at pak2.ads:5:4 |
gnatmake -gnat05 pak1-pak3.ads
gcc-4.1 -c -gnat05 pak1-pak3.ads
pak1-pak3.ads:3:15: invalid constraint: type has no discriminant
pak1-pak3.ads:4:14: no value supplied for discriminant "D"
GCC 4.2:
% gcc -c pak2.ads
+===========================GNAT BUG DETECTED==============================+
| 4.2.2 (i686-unknown-linux-gnu) Assert_Failure einfo.adb:814 |
| Error detected at pak2.ads:5:4 |
% gcc -c pak1-pak3.ads
pak1-pak3.ads:3:15: invalid constraint: type has no discriminant
pak1-pak3.ads:4:14: no value supplied for discriminant "D"
As can be seen, Pak1.Pak3 and Pak2 are identical but only Pak2 triggers the
bug.
--
Summary: Bug box, Assert_Failure einfo.adb:814 on illegal Ada
2005 program
Product: gcc
Version: 4.1.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=34507