diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-12-15 19:53:27 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-12-15 19:53:57 +0300 |
commit | bd3de93557ce1e3af1ec33530add1f7831f09db6 (patch) | |
tree | e765fc755e5f433edccc527738422fba54f9fcfa /extern | |
parent | 26bb0ee4641ff605e2ea397149762515fdf593a4 (diff) |
Gtest: Fix/workaround MSVC complains about use of struct with alignment
Diffstat (limited to 'extern')
-rw-r--r-- | extern/gtest/include/gtest/internal/gtest-internal.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/extern/gtest/include/gtest/internal/gtest-internal.h b/extern/gtest/include/gtest/internal/gtest-internal.h index ebd1cf615de..ca15a2f3a78 100644 --- a/extern/gtest/include/gtest/internal/gtest-internal.h +++ b/extern/gtest/include/gtest/internal/gtest-internal.h @@ -60,6 +60,10 @@ #include <string> #include <vector> +#if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) +# include <type_traits> +#endif + #include "gtest/gtest-message.h" #include "gtest/internal/gtest-string.h" #include "gtest/internal/gtest-filepath.h" @@ -854,6 +858,7 @@ struct AddReference<T&> { typedef T& type; }; // NOLINT template <typename From, typename To> class ImplicitlyConvertible { private: +#if !((__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800)) // We need the following helper functions only for their types. // They have no implementations. @@ -874,6 +879,7 @@ class ImplicitlyConvertible { // implicitly converted to type To. static char Helper(To); static char (&Helper(...))[2]; // NOLINT +#endif // We have to put the 'public' section after the 'private' section, // or MSVC refuses to compile the code. @@ -883,6 +889,8 @@ class ImplicitlyConvertible { // instantiation. The simplest workaround is to use its C++0x type traits // functions (C++Builder 2009 and above only). static const bool value = __is_convertible(From, To); +#elif (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) + static const bool value = std::is_convertible<From, To>::value; #else // MSVC warns about implicitly converting from double to int for // possible loss of data, so we need to temporarily disable the |