Skip to content

Prohibit C++11 move from Document to Value#391

Merged
miloyip merged 1 commit intoTencent:masterfrom
pah:fix/no-doc2value-move
Jul 20, 2015
Merged

Prohibit C++11 move from Document to Value#391
miloyip merged 1 commit intoTencent:masterfrom
pah:fix/no-doc2value-move

Conversation

@pah
Copy link
Copy Markdown
Contributor

@pah pah commented Jul 20, 2015

As reported in #387, silently moving a GenericDocument to a GenericValue can lead to object slicing and premature deletion of the owning allocator of the (surviving) GenericValue.

To reduce this risk, prohibit move construction/assignment of a GenericValue from a GenericDocument.

As reported in Tencent#387, silently moving a `GenericDocument` to a
`GenericValue` can lead to object slicing and premature deletion of
the owning allocator of the (surviving) `GenericValue`.

To reduce this risk, prohibit move construction of a `GenericValue`
from a `GenericDocument`.
miloyip added a commit that referenced this pull request Jul 20, 2015
Prohibit C++11 move from Document to Value
@miloyip miloyip merged commit 3003b84 into Tencent:master Jul 20, 2015
@miloyip
Copy link
Copy Markdown
Collaborator

miloyip commented Jul 20, 2015

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants