Permalink
Browse files

fix Issue 9099 - core.atomic.atomicLoad() cannot handle non-POD structs

  • Loading branch information...
1 parent 62f27eb commit 878a183a51825ea5dce25f4289a8ef001f6eeea1 @WalterBright WalterBright committed Dec 30, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/core/atomic.d
View
@@ -369,7 +369,11 @@ else version( AsmX86_32 )
HeadUnshared!(T) atomicLoad(MemoryOrder ms = MemoryOrder.seq, T)( ref const shared T val ) nothrow
if(!__traits(isFloating, T))
{
- static if( T.sizeof == byte.sizeof )
+ static if (!__traits(isPOD, T))
+ {
+ static assert( false, "argument to atomicLoad() must be POD" );
+ }
+ else static if( T.sizeof == byte.sizeof )
{
//////////////////////////////////////////////////////////////////
// 1 Byte Load

0 comments on commit 878a183

Please sign in to comment.