When building the driver with GCC 7, the following (false positive?) error is emitted:
In file included from ../src/bsoncxx/array/value.hpp:21:0, from ../src/bsoncxx/array/view_or_value.hpp:17, from ../src/bsoncxx/builder/concatenate.hpp:17, from ../src/bsoncxx/builder/basic/helpers.hpp:17, from ../src/bsoncxx/builder/basic/sub_array.hpp:17, from ../src/bsoncxx/builder/basic/impl.hpp:17, from ../src/bsoncxx/builder/basic/document.hpp:17, from ../src/bsoncxx/test/view_or_value.cpp:15: ../src/bsoncxx/document/value.hpp: In function 'void {anonymous}::____C_A_T_C_H____T_E_S_T____31()': ../src/bsoncxx/document/value.hpp:108:63: warning: 'copied.bsoncxx::v_noabi::document::value::_length' may be used uninitialized in this function [-Wmaybe-uninitialized] return document::view{static_cast<uint8_t*>(_data.get()), _length}; ^~~~~~~ ../src/bsoncxx/document/value.hpp:108:63: warning: 'moved.bsoncxx::v_noabi::document::value::_length' may be used uninitialized in this function [-Wmaybe-uninitialized] return document::view{static_cast<uint8_t*>(_data.get()), _length}; ^~~~~~~
As this is a user facing header, this warning is likely to cause problems for users. We should investigate and make a determination as to whether GCC is truly warning us about something dangerous, or is being overzealous, before issuing 3.2.0.
Note that clang does not issue a warning here.