[Issue 9375] New: wrong code when assigning to ref in CTFE
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jan 22 18:13:42 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9375
Summary: wrong code when assigning to ref in CTFE
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: CTFE, wrong-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: nilsbossung at googlemail.com
--- Comment #0 from Nils <nilsbossung at googlemail.com> 2013-01-22 18:13:41 PST ---
Related to issue 7887. While 7887 ICEs, this one compiles, but produces wrong
values.
ref r(ref int[][] a) {
return a[0];
}
auto go() {
int[][] a = [[]];
r(a) = [42];
return a;
}
void main() {
enum ct = go();
auto rt = go();
assert(ct == rt); // fails
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list