Bug 6568 – access qualifiers and delegate template parameter
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-08-28T09:37:00Z
Last change time
2014-11-18T04:51:04Z
Assigned to
nobody
Creator
zeljko.grk
Comments
Comment #0 by zeljko.grk — 2011-08-28T09:37:51Z
import std.stdio;
struct S(alias Fun){
// public: // uncomment to break compilation
int x;
void f() {
writefln("%s, %d", Fun()? "yes":"no", x);
}
}
void f1(int a, int b){
auto s = S!({ return a < b; })(3);
s.f();
}
void main(){
f1(10, 20);
}
This compiles and works as expected.
But as soon as I added any access qualifier (even one redundant 'public:') to structure S, compilation breaks with message:
bug001.d(9): Error: function bug01.f1.S!(delegate nothrow bool()
{
return a < b;
}
).S.f cannot get frame pointer to __dgliteral1
Comment #1 by lovelydear — 2012-04-27T10:10:31Z
Also fails on 2.059 Win32
Comment #2 by hsteoh — 2014-11-18T04:51:04Z
Seems to work on git HEAD. Tested on Linux/64. Please reopen if problem reoccurs.