Bug 1904 – wrong protection lookup for private template functions

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2008-03-10T23:49:00Z
Last change time
2014-02-15T13:21:53Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
andrei
Blocks
5003

Comments

Comment #0 by andrei — 2008-03-10T23:49:21Z
Consider this two-file project: // test.d import testmod; void main() { void whatever() {} foo!(whatever)(); } // testmod.d private void bar(alias a)() {} void foo(alias a)() { .bar!(a)(); } Compiling test.d yields: testmod.d(5): Error: function test.bar is not accessible from testmod test.d(6): template instance test.main.foo!(whatever) error instantiating (I thought I submitted this once, but I couldn't find it.)
Comment #1 by smjg — 2008-11-20T20:10:02Z
The problems seems to be that the templates are being semantically analysed in the wrong scope.
Comment #2 by clugdbug — 2010-04-27T11:17:10Z
This applies even to ancient versions of D1.
Comment #3 by k.hara.pg — 2011-07-14T04:23:51Z
Comment #4 by bugzilla — 2011-07-31T01:30:51Z