Bug 8255 – [CTFE] ICE when passing 'ref' literal

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-16T15:47:50Z
Last change time
2021-02-20T05:57:39Z
Keywords
CTFE, ice
Assigned to
No Owner
Creator
dlang+issues
Depends on
7988
See also
https://issues.dlang.org/show_bug.cgi?id=21647

Comments

Comment #0 by dlang+issues — 2012-06-16T15:47:50Z
struct G { } struct F(T) { void f(ref T) { } } pragma(msg, F!G().f(G.init)); void main() { }
Comment #1 by k.hara.pg — 2012-06-17T00:10:51Z
This is the CTFE problem on out of function scope. struct G {} struct F(T) { void f(ref T) {} } pragma(msg, F!G().f(G.init)); // ICE enum b = { F!G().f(G.init); return true; }(); // OK void main() { F!G().f(G.init); // OK }
Comment #2 by clugdbug — 2012-09-26T00:45:55Z
Before CTFE begins, the code in comment 1 is translated into: F().f((G __tmpsl5 = G(); , __tmpsl5)) The problem is that the comma expression is evaluated outside of CTFE. This would be fixed by bug 7988.
Comment #3 by bugzilla — 2013-10-06T23:21:23Z
I get the following message from 2.064 head: test.d(3): Error: function test.F!(G).F.f (ref G _param_0) is not callable using argument types (G) test.d(3): while evaluating pragma(msg, F().f(G())) No ice.
Comment #4 by github-bugzilla — 2013-11-16T00:59:38Z