public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: tim.green@iplbath.com
To: gcc-gnats@gcc.gnu.org
Subject: ada/7889: Instantiation of Generic Granchild Package fails
Date: Wed, 11 Sep 2002 09:16:00 -0000	[thread overview]
Message-ID: <20020911160815.2295.qmail@sources.redhat.com> (raw)


>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:


             reply	other threads:[~2002-09-11 16:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-11  9:16 tim.green [this message]
2003-05-12 23:46 Dara Hazeghi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020911160815.2295.qmail@sources.redhat.com \
    --to=tim.green@iplbath.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).