Permalink
Browse files

fix

Issue 9099 - core.atomic.atomicLoad() cannot handle non-POD structs
  • Loading branch information...
1 parent 62f27eb commit a15d228ed0c1a3bfb5bd05ec1d491802bb29aac0 @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 a15d228

Please sign in to comment.