← Back to index
|
Original Bugzilla link
Bug 24736 – core.atomic is not work with struct that has template parameter list and function pointer (-preview=all)
Status
NEW
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2024-09-01T07:14:35Z
Last change time
2024-12-01T16:42:55Z
Assigned to
No Owner
Creator
Haruki Shigemori
Moved to GitHub: phobos#9876 →
Comments
Comment #0
by rayerd.wiz — 2024-09-01T07:14:35Z
import core.atomic; // Compile within -preview=all enum VARS_AFTER_FP = true; synchronized shared class A { static void proc() {} void fn(ARGS...)(ARGS args) { static struct S { static if (VARS_AFTER_FP) { void function() fp; ARGS vars; } else { ARGS vars; void function() fp; } } S s; s.fp.atomicStore(&proc); static foreach (i, e; args) { s.vars[i].atomicStore(e.atomicLoad()); } } } void main() { auto a = new A; a.fn(1); // OK a.fn(2, "str"); // Runtime error when VARS_AFTER_FP is false. a.fn("str", 3); // Runtime error when VARS_AFTER_FP is true. }
Comment #1
by robert.schadek — 2024-12-01T16:42:55Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/phobos/issues/9876
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB