Skip to content

Conversation

eramongodb
Copy link
Contributor

Followup to #1470. Per MSVC:

scoped_bson.hh(46): warning C4927: illegal conversion; more than one user-defined conversion has been implicitly applied
scoped_bson.hh(46): note: while calling the constructor 'mongocxx::scoped_bson_view::scoped_bson_view(bsoncxx::v1::document::view)'

This might be a false-positive. to_v1(v) returns a v1::array::view, which uses its user-defined conversion function to convert to a v1::document::view, the parameter type requested by the scoped_bson_view ctor. I wonder if the use of {}-initialization without a typename is confusing the compiler into thinking there is another layer of implicit conversion occurring here. Nevertheless, the workaround is trivial (simply making the array -> document conversion explicit).

@eramongodb eramongodb requested a review from kevinAlbs October 9, 2025 14:33
@eramongodb eramongodb self-assigned this Oct 9, 2025
@eramongodb eramongodb requested a review from a team as a code owner October 9, 2025 14:33
@eramongodb eramongodb merged commit d463e39 into mongodb:master Oct 9, 2025
15 of 16 checks passed
@eramongodb eramongodb deleted the cxx-scoped_bson branch October 9, 2025 16:00
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