This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/15847] New: Legal program rejected, RM 3.10.2(32)
- 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: 6 Jun 2004 10:23:58 -0000
- Subject: [Bug ada/15847] New: Legal program rejected, RM 3.10.2(32)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
-- 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