Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 878a183a51825ea5dce25f4289a8ef001f6eeea1 1 parent 62f27eb
Walter Bright authored December 29, 2012

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  src/core/atomic.d
6  src/core/atomic.d
@@ -369,7 +369,11 @@ else version( AsmX86_32 )
369 369
     HeadUnshared!(T) atomicLoad(MemoryOrder ms = MemoryOrder.seq, T)( ref const shared T val ) nothrow
370 370
     if(!__traits(isFloating, T))
371 371
     {
372  
-        static if( T.sizeof == byte.sizeof )
  372
+        static if (!__traits(isPOD, T))
  373
+        {
  374
+            static assert( false, "argument to atomicLoad() must be POD" );
  375
+        }
  376
+        else static if( T.sizeof == byte.sizeof )
373 377
         {
374 378
             //////////////////////////////////////////////////////////////////
375 379
             // 1 Byte Load

0 notes on commit 878a183

Please sign in to comment.
Something went wrong with that request. Please try again.