You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building Flatbuffers tests v2.0.7 with GCC 4.8.5 (CentOS 7) fails with a series of errors pertaining to the initialiser list / explicit constructor. One example:
.../flatbuffers/tests/test.cpp: In function ‘void {anonymous}::UtilConvertCase()’: .../flatbuffers/tests/test.cpp:1509:9: error: converting to ‘std::tuple<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, flatbuffers::Case, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >’ from initializer list would use explicit constructor ‘constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {const char (&)[20], flatbuffers::Case, const char (&)[17]}; <template-parameter-2-2> = void; _Elements = {std::basic_string<char, std::char_traits<char>, std::allocator<char> >, flatbuffers::Case, std::basic_string<char, std::char_traits<char>, std::allocator<char> >}]’ };
It appears that the tests are written using the initialiser list sytax compatible with C++14 standard library and above, and not the one compatible with C++11.
Thanks, Looks like we need CI for gcc with --std=c++11 explicitly set. Most users are probably compiling with a later standard and don't have the error.
You might consider being more strict regarding the C++ standard to be used by the individual targets - that is, using the CMAKE_CXX_STANDARD approach rather than the "compiler features" approach (the former translates to --std=c++11 with GCC).
The "compiler features" approach is more suitable for an "end user project", whereas Flatbuffers is a rather special case - it's not even a library, but more of a compile-time code generation utility.
Obviously, you want the generated Flatbuffers C++ code to conform to the specific C++ standard, in order to establish the minimum C++ standard required for projects that use Flatbuffers. In the view of that, it makes sense to force a specific standard (i.e. not to allow a higher standard) for the test targets. CMAKE_CXX_STANDARD can be defined on a target-per-target basis, so having C++17-specific tests should not be an issue.
Building Flatbuffers tests v2.0.7 with GCC 4.8.5 (CentOS 7) fails with a series of errors pertaining to the initialiser list / explicit constructor. One example:
.../flatbuffers/tests/test.cpp: In function ‘void {anonymous}::UtilConvertCase()’: .../flatbuffers/tests/test.cpp:1509:9: error: converting to ‘std::tuple<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, flatbuffers::Case, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >’ from initializer list would use explicit constructor ‘constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {const char (&)[20], flatbuffers::Case, const char (&)[17]}; <template-parameter-2-2> = void; _Elements = {std::basic_string<char, std::char_traits<char>, std::allocator<char> >, flatbuffers::Case, std::basic_string<char, std::char_traits<char>, std::allocator<char> >}]’ };
It appears that the tests are written using the initialiser list sytax compatible with C++14 standard library and above, and not the one compatible with C++11.
See e.g. https://stackoverflow.com/questions/26947704/implicit-conversion-failure-from-initializer-list
The text was updated successfully, but these errors were encountered: