ada/7889: Instantiation of Generic Granchild Package fails

tim.green@iplbath.com tim.green@iplbath.com
Wed Sep 11 09:16:00 GMT 2002


>Number:         7889
>Category:       ada
>Synopsis:       Instantiation of Generic Granchild Package fails
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 11 09:16:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Timothy Green
>Release:        gcc version 2.8.1
>Organization:
>Environment:
DOS Window running under Win 2000 Pro
>Description:
GNAT will not allow generic grandchild packages to be instantiated.

The following errors are generated:
> gnatmake Run_Gen
gcc -c run_gen.adb
gen_fullexe_short.ada:68:01: instantiation error at gen_fullexe_short.ada:59
gen_fullexe_short.ada:68:01: "GB" not declared in "P_GAI"
gnatmake: "run_gen.adb" compilation error
>How-To-Repeat:
-- Parent
package P is
	type PT is new INTEGER;
	PINT : PT;
end P;

-- Generic Child
generic
	type PGT is digits <>;
package P.GA is
	GAX : PGT;
end P.GA;

-- Generic Grand Child
generic 
	type T is digits <>;
package P.GA.GB is
	type R is record
		A : T;
		B : T;
	end record;

	procedure F;

	X : R;
end P.GA.GB;

package body P.GA.GB is
	procedure F is
	begin
		X.A := 1.0;
		X.B := 2.0;
	end F;
end P.GA.GB;

-- Instantiation of Parent.Child
with P.GA;
package P_GAI is new P.GA(Float);

-- Instantiation of Parent.Child.Grand_Child
with P.GA.GB;
with P_GAI;
package P_GAI_GBI is new P_GAI.GB(Float);

-- Code to build simple executable

package P.TSP is
VAR1 : Natural;
end P.TSP;
with P.TSP;
package TSP_P renames P.TSP;

generic package P.GA.TSP is
VAR2 : Natural;
end P.GA.TSP;

generic package P.GA.GB.TSP is
VAR3 : Natural;
X : STANDARD.P.GA.GB.R;
end P.GA.GB.TSP;

with P_GAI;
with P.GA.TSP;
package TSP_P_GAI is new STANDARD.P_GAI.TSP;

with P_GAI_GBI; 
with P.GA.GB.TSP;
package TSP_P_GAI_GBI is new STANDARD.P_GAI_GBI.TSP;

-- Main procedure
with TSP_P_GAI_GBI;
procedure run_gen is
A : Natural;	
begin
	A := 1;
end;
>Fix:
Not Known. Compiles OK with Object Ada and GreenHills compiler.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list