expected icon indicating copy to clipboard operation
expected copied to clipboard

Fix Test failing on GCC and Clang

Open ObiWahn opened this issue 6 years ago • 3 comments

I hope this change resolves the error:

-      val() = std::move(temp);
+      new (valptr()) T(std::move(temp));

ObiWahn avatar Dec 27 '19 22:12 ObiWahn

FIX: https://github.com/TartanLlama/expected/issues/65

ObiWahn avatar Dec 28 '19 20:12 ObiWahn

This fixed a crash in -O3 builds for us when a std::shared_ptr was the expected type. I'm... really, really not sure why that is... it looks like maybe the implementation of the assignment operator was decrementing the ref count down to zero in the shared_ptr's destructor, freeing the underlying object, then trying to re-increment the ref count?

In any case, thanks @ObiWahn!

s3cur3 avatar Jul 23 '20 15:07 s3cur3

@TartanLlama what is required to get this merged? Do you want me to revert the whitespace changes?

ObiWahn avatar Jul 23 '20 18:07 ObiWahn