Bug 6123 – [CTFE] Cannot call a template member method inside delegate/function literal with -inline.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Mac OS X
Creation time
2011-06-08T00:47:00Z
Last change time
2011-06-11T06:42:31Z
Keywords
rejects-valid
Assigned to
nobody
Creator
kennytm

Comments

Comment #0 by kennytm — 2011-06-08T00:47:55Z
Test case: ------------------------- struct Bug6123(T) { void f() {} // can also trigger if the struct is normal but f is template } static assert({ auto piece = Bug6123!int(); piece.f(); return true; }()); ------------------------- Error: Cannot interpret &this at compile time x.d(8): Error: cannot evaluate delegate bool() { Bug6123!(int) piece = Bug6123(); ref Bug6123!(int) this = piece; , assert(&this,"null this"); return true; } () at compile time x.d(4): Error: static assert (delegate bool() { Bug6123!(int) piece = Bug6123(); ref Bug6123!(int) this = piece; , assert(&this,"null this"); return true; } ()) is not evaluatable at compile time ------------------------- (Why that 'assert' is generated in CTFE anyway?)
Comment #1 by clugdbug — 2011-06-11T06:42:31Z