[Issue 16277] New: Can't use atomicStore with classes or interface
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Jul 13 14:06:14 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16277
Issue ID: 16277
Summary: Can't use atomicStore with classes or interface
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: blocker
Priority: P1
Component: druntime
Assignee: nobody at puremagic.com
Reporter: aliloko at gmail.com
Is this normal?
-------------------------------
interface IL
{
}
import core.atomic;
void main()
{
IL i;
shared(IL) j;
atomicStore(j, i);
}
-------------------------------
As of DMD 2.071, this gives an error:
/d391/f135.d(12): Error: template core.atomic.atomicStore cannot deduce
function from argument types !()(shared(IL), IL), candidates are:
/opt/compilers/dmd2/include/core/atomic.d(1100):
core.atomic.atomicStore(MemoryOrder ms = MemoryOrder.seq, T, V1)(ref shared T
val, V1 newval) if (__traits(compiles, () { val = newval; } ))
Is that constraint { val = newval; } valid?
I would have thought atomics would work with types who are just pointers, like
class instances and interfaces.
--
More information about the Digitalmars-d-bugs
mailing list