[Bug ada/15847] New: Legal program rejected, RM 3.10.2(32)
ludovic dot brenta at insalien dot org
gcc-bugzilla@gcc.gnu.org
Sun Jun 6 10:23:00 GMT 2004
-- the compiler apparently is complaining that type T1 is declared outside
-- of pak2, in violation of the last sentence of RM 3.10.2(32),
-- but T1 is declared by the instantiation new_pak4, which _is_ declared
-- inside of pak2.
procedure Test_247023 is
generic
package pak4 is
type T1 is access procedure;
procedure p1 (Proc: T1);
end pak4;
package body pak4 is
procedure p1 (Proc: T1) is
begin
null;
end;
end pak4;
generic
package pak2 is
package new_pak4 is new pak4;
end pak2;
package body pak2 is
procedure p3 is
begin
null;
end p3;
begin
new_pak4.p1 (p3'Access); --OK
end pak2;
begin
null;
end Test_247023;
The compiler incorrectly reports:
test_247023.adb:33:20: access type must not be outside generic body
gnatmake: "test_247023.adb" compilation error
--
Summary: Legal program rejected, RM 3.10.2(32)
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ludovic dot brenta at insalien dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15847
More information about the Gcc-bugs
mailing list