From 2809be87cc7e7d04a2af8d84355155b64611b479 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Thu, 20 Apr 2017 14:38:57 +0100 Subject: [PATCH] =?UTF-8?q?=E2=80=9Cfixed=E2=80=9D=20alignment=20in=20Opti?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/internal/catch_option.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/internal/catch_option.hpp b/include/internal/catch_option.hpp index 5413abf0..61175ae9 100644 --- a/include/internal/catch_option.hpp +++ b/include/internal/catch_option.hpp @@ -66,7 +66,10 @@ namespace Catch { } private: - T* nullableValue; + union { + T *nullableValue; + long double _; // Forces alignment for the storage, following + }; char storage[sizeof(T)]; };