Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit e6ba31c

Browse files
authored
Merge pull request #2753 from TurkeyMan/reintroduce_const_bug
Reintroduce const violation bug to fix vibe.d build failure
2 parents 2807d0e + f052f08 commit e6ba31c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/atomic.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ enum MemoryOrder
6666
* Returns:
6767
* The value of 'val'.
6868
*/
69-
T atomicLoad(MemoryOrder ms = MemoryOrder.seq, T)( ref T val ) pure nothrow @nogc @trusted
69+
T atomicLoad(MemoryOrder ms = MemoryOrder.seq, T)( ref const T val ) pure nothrow @nogc @trusted
7070
if ( !is( T == shared U, U ) && !is( T == shared inout U, U ) && !is( T == shared const U, U ) )
7171
{
7272
static if ( __traits(isFloating, T) )
@@ -76,11 +76,11 @@ T atomicLoad(MemoryOrder ms = MemoryOrder.seq, T)( ref T val ) pure nothrow @nog
7676
return *cast(T*)&r;
7777
}
7878
else
79-
return core.internal.atomic.atomicLoad!ms(&val);
79+
return core.internal.atomic.atomicLoad!ms(cast(T*)&val);
8080
}
8181

8282
/// Ditto
83-
T atomicLoad(MemoryOrder ms = MemoryOrder.seq, T)( ref shared T val ) pure nothrow @nogc @trusted
83+
T atomicLoad(MemoryOrder ms = MemoryOrder.seq, T)( ref const shared T val ) pure nothrow @nogc @trusted
8484
if ( !hasUnsharedIndirections!T )
8585
{
8686
import core.internal.traits : hasUnsharedIndirections;
@@ -90,7 +90,7 @@ T atomicLoad(MemoryOrder ms = MemoryOrder.seq, T)( ref shared T val ) pure nothr
9090
}
9191

9292
/// Ditto
93-
TailShared!T atomicLoad(MemoryOrder ms = MemoryOrder.seq, T)( ref shared T val ) pure nothrow @nogc @trusted
93+
TailShared!T atomicLoad(MemoryOrder ms = MemoryOrder.seq, T)( ref const shared T val ) pure nothrow @nogc @trusted
9494
if ( hasUnsharedIndirections!T )
9595
{
9696
// HACK: DEPRECATE THIS FUNCTION, IT IS INVALID TO DO ATOMIC LOAD OF SHARED CLASS

0 commit comments

Comments
 (0)