Parent pointer not properly set when using update() #3007
Labels
confirmed
kind: bug
release item: 🐛 bug fix
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
Milestone
When
update()
is used to insert new elements into annlohmann::json
, the parent pointers inside the newly inserted elements don't seem to be properly set.What is the issue you have?
When parent pointers are not set correctly, an assert goes off when
check_invariants()
is later called on the object. This only happens when JSON_DIAGNOSTICS is enabled.This might be related to #2926. Although as far as I can see, this has nothing to do with serialization.
Please describe the steps to reproduce the issue.
Live example: https://godbolt.org/z/Ms5hP35fW
Can you provide a small but working code example?
Same as the live code:
What is the expected behavior?
Parent pointers should be properly set. As a result no assert should go off.
And what is the actual behavior instead?
Parent pointers are not set, assertion goes off as a result.
Which compiler and operating system are you using?
Tested with:
Which version of the library did you use?
develop
branchThe text was updated successfully, but these errors were encountered: