This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/52319] New: Legal program rejected, "use" clause in subpackage invalidates "use type" clause
- From: "nicolas.boulenguez at free dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 20 Feb 2012 22:38:38 +0000
- Subject: [Bug ada/52319] New: Legal program rejected, "use" clause in subpackage invalidates "use type" clause
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52319
Bug #: 52319
Summary: Legal program rejected, "use" clause in subpackage
invalidates "use type" clause
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: nicolas.boulenguez@free.fr
The following legal program is rejected by "gnatgcc -c proc.adb" with
proc.adb:17:28: there is no applicable operator "And" for type
"Standard.Integer"
All works fine if P2 is removed.
procedure Proc is
package P1 is
type T is new Integer;
function "and" (L, R : in Integer) return T;
end P1;
package body P1 is
function "and" (L, R : in Integer) return T is
pragma Unreferenced (L, R);
begin
return 0;
end "and";
end P1;
use type P1.T;
package P2 is
use P1;
end P2;
G : P1.T := Integer'(1) and Integer'(2);
begin
null;
end Proc;