From bffef1bffa5d35c22168fe011bc7aad9a1e4c228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Mon, 8 May 2017 00:59:44 +0200 Subject: [PATCH] Fix alignment for Catch::Option This is so much easier in C++11... --- include/internal/catch_option.hpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/include/internal/catch_option.hpp b/include/internal/catch_option.hpp index 8b146da6..6653649e 100644 --- a/include/internal/catch_option.hpp +++ b/include/internal/catch_option.hpp @@ -67,15 +67,7 @@ namespace Catch { private: T *nullableValue; - union { - char storage[sizeof(T)]; - - // These are here to force alignment for the storage - long double dummy1; - void (*dummy2)(); - long double dummy3; - long long dummy4; - }; + alignas(alignof(T)) char storage[sizeof(T)]; }; } // end namespace Catch