Skip to content

Commit

Permalink
Fix improper static_cast in custom base class test
Browse files Browse the repository at this point in the history
  • Loading branch information
colbychaskell committed Nov 25, 2023
1 parent 70e1edc commit 3ebae82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/src/unit-custom-base-class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ template <class Ptr, class Fnc>
void visitor_adaptor::do_visit(const Ptr& ptr, const Fnc& fnc) const
{
using value_t = nlohmann::detail::value_t;
const json_with_visitor_t& json = *static_cast<const json_with_visitor_t*>(this);
const json_with_visitor_t& json;
memcpy(&json, this, sizeof(this));
switch (json.type())
{
case value_t::object:
Expand Down

0 comments on commit 3ebae82

Please sign in to comment.