I'm getting above error while building the gtest (1.14.0) in visual studio 2022 (Platform Toolset - Visual Studio 2015 - Windows XP (v140_xp))
template <typename M, bool = MatcherBase::IsInlined<M>()> struct ValuePolicy { static const M& Get(const MatcherBase& m) { // When inlined along with Init, need to be explicit to avoid violating // strict aliasing rules. const M* ptr = static_cast<const M*>(static_cast<const void*>(&m.buffer_)); return *ptr; } static void Init(MatcherBase& m, M impl) { ::**new (static_cast<void*>(&m.buffer_)) M(impl);** //// Getting error on this line of code. } static constexpr auto shared_destroy = nullptr; };
Steps to reproduce the problem
While building to consume the gmock with our visual studio project.
What version of GoogleTest are you using?
1.14.0
What operating system and version are you using?
Edition Windows 11 Enterprise
Version 23H2
Installed on 2/8/2024
OS build 22631.3880
Experience Windows Feature Experience Pack 1000.22700.1020.0
What compiler and version are you using?
Visual studio 2022 (Platform Toolset - Visual Studio 2015 - Windows XP (v140_xp))
Describe the issue
I'm getting above error while building the gtest (1.14.0) in visual studio 2022 (Platform Toolset - Visual Studio 2015 - Windows XP (v140_xp))
template <typename M, bool = MatcherBase::IsInlined<M>()> struct ValuePolicy { static const M& Get(const MatcherBase& m) { // When inlined along with Init, need to be explicit to avoid violating // strict aliasing rules. const M* ptr = static_cast<const M*>(static_cast<const void*>(&m.buffer_)); return *ptr; } static void Init(MatcherBase& m, M impl) { ::**new (static_cast<void*>(&m.buffer_)) M(impl);** //// Getting error on this line of code. } static constexpr auto shared_destroy = nullptr; };
Steps to reproduce the problem
While building to consume the gmock with our visual studio project.
What version of GoogleTest are you using?
1.14.0
What operating system and version are you using?
Edition Windows 11 Enterprise Version 23H2 Installed on 2/8/2024 OS build 22631.3880 Experience Windows Feature Experience Pack 1000.22700.1020.0
What compiler and version are you using?
Visual studio 2022 (Platform Toolset - Visual Studio 2015 - Windows XP (v140_xp))
What build system are you using?
MSVC
Additional context
No response