Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

“fixed” alignment in Option

Commit
2809be87cc7e7d04a2af8d84355155b64611b479
Author
Phil Nash ·
Parents
ac369b7b8362

Files · Download .tar.gz

Changes

 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)];
     };