Bug 24167 - Visibility of private component of parent in child generic, generic compiles but instantiation doesn't
Summary: Visibility of private component of parent in child generic, generic compiles ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.6.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-02 17:09 UTC by simon
Modified: 2011-09-16 17:30 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-10-02 17:52:43


Attachments
Demonstration of problem (1.08 KB, application/octet-stream)
2005-10-02 17:11 UTC, simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description simon 2005-10-02 17:09:41 UTC
The example (which I will upload directly) fails as follows:

grendel:~/tmp/visibility simon$ gnatmake -c -u -f actual-s.ads
gcc -c actual-s.ads
actual-s.ads:4:01: instantiation error at basis-second.adb:4
actual-s.ads:4:01: no selector "Started" for type "Base" defined at basis-second.ads:4, instance at line 4
gnatmake: "actual-s.ads" compilation error

I think the code should have compiled, because the selector Started is defined in the private part of the parent package Basis.

However

grendel:~/tmp/visibility simon$ gnatmake -c -u -f basis-second.adb
gcc -c basis-second.adb
grendel:~/tmp/visibility simon$ 

In other words, the generic compiles but the instantiation doesn't, which is not meant to happen.
Comment 1 simon 2005-10-02 17:11:18 UTC
Created attachment 9861 [details]
Demonstration of problem
Comment 2 Laurent GUERBY 2005-10-02 17:52:43 UTC
Same message on mainline, however I'm not able to say wether it's a bug or not.
Comment 3 Laurent GUERBY 2009-01-02 15:17:16 UTC
Still there with 4.3.2 and
gcc version 4.4.0 20081228 (experimental) [trunk revision 142939] (GCC) 

Arnaud, do you have a generic expert handy to check wether this code is legal or not? generic compiling but not an instance is quite rare in the language. Thanks!
Comment 4 simon 2010-01-07 17:34:13 UTC
Still there with gcc version 4.5.0 20100104 (experimental) (GCC) (r155633)
Comment 5 simon 2011-09-16 17:27:27 UTC
Fixed in 4.6.0.

Am I allowed/able to mark this RESOLVED?
Comment 6 Arnaud Charlet 2011-09-16 17:30:48 UTC
Fixing then, thanks.