Compilation is failing on tests when using gcc 10.1.0.
flatbuffers/tests/arrays_test_generated.h: In constructor ‘MyGame::Example::ArrayStruct::ArrayStruct(float, int8_t, int32_t)’:
flatbuffers/tests/arrays_test_generated.h:156:34: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct MyGame::Example::NestedStruct’; use assignment or value-initialization instead [-Werror=class-memaccess]
156 | std::memset(d_, 0, sizeof(d_));
| ^
flatbuffers/tests/arrays_test_generated.h:66:40: note: ‘struct MyGame::Example::NestedStruct’ declared here
66 | FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) NestedStruct FLATBUFFERS_FINAL_CLASS {
| ^~~~~~~~~~~~
Master branch and v1.12.0 tag are affected, didn't test other tags
Setup
- gcc 10.1.0
- flatbuffers 1.12.0 or master
Reproducing
- cd to flatbuffers folders
- run:
$ mkdir build && cd build
$ cmake .. #FLATBUFFERS_BUILD_TESTS is enabled by default
$ cmake --build .