Skip to content

Commit ae8e8af

Browse files
committed
RCPP-62 Get to bottom of test failure on gcc8
1 parent c696d01 commit ae8e8af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cpprealm/bson.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace realm {
2929
bsoncxx::bsoncxx(const bsoncxx& v) noexcept
3030
{
3131
#ifdef CPPREALM_HAVE_GENERATED_BRIDGE_TYPES
32-
*reinterpret_cast<bson::Bson*>(&m_bson) = *reinterpret_cast<const bson::Bson*>(&v.m_bson);
32+
new (&m_bson) bson::Bson(*reinterpret_cast<const bson::Bson*>(&v.m_bson));
3333
#else
3434
m_bson = v.m_bson;
3535
#endif
@@ -38,7 +38,7 @@ namespace realm {
3838
bsoncxx::bsoncxx(bsoncxx&& v) noexcept
3939
{
4040
#ifdef CPPREALM_HAVE_GENERATED_BRIDGE_TYPES
41-
*reinterpret_cast<bson::Bson*>(&m_bson) = std::move(*reinterpret_cast<bson::Bson*>(&v.m_bson));
41+
new (&m_bson) bson::Bson(std::move(*reinterpret_cast<bson::Bson*>(&v.m_bson)));
4242
#else
4343
m_bson = std::move(v.m_bson);
4444
#endif

0 commit comments

Comments
 (0)