Skip to content

C++ 11 compilation broken #8857

@greenrobot

Description

@greenrobot

The current code may work with some C++11 compilers, but it's not official and will break some compilers. I'll do a PR next to fix it.

-- CMAKE_C_COMPILER_VERSION: 8.3.0
aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36)) 8.3.0

Compile errors:


../../../../../../../objectbox/src/main/cpp/external/flatbuffers/flatbuffers.h:266:5: error: body of 'constexpr' function 'constexpr objectbox::UserFlags objectbox::operator|=(objectbox::UserFlags&, objectbox::UserFlags)' not a return-statement
     }\
     ^~
     inline FLATBUFFERS_CONSTEXPR_CPP11 E operator &= (E &lhs, E rhs){\
      
../../../../../../../objectbox/src/main/cpp/external/flatbuffers/flatbuffers.h:266:5: note: in definition of macro 'FLATBUFFERS_DEFINE_BITMASK_OPERATORS'
     }\
     ^~
     inline FLATBUFFERS_CONSTEXPR_CPP11 E operator &= (E &lhs, E rhs){\
      
../../../../../../../objectbox/src/main/cpp/user/user_generated.h: In function 'constexpr objectbox::UserFlags objectbox::operator&=(objectbox::UserFlags&, objectbox::UserFlags)':
../../../../../../../objectbox/src/main/cpp/external/flatbuffers/flatbuffers.h:270:5: error: body of 'constexpr' function 'constexpr objectbox::UserFlags objectbox::operator&=(objectbox::UserFlags&, objectbox::UserFlags)' not a return-statement
     }\
     ^~
     inline FLATBUFFERS_CONSTEXPR_CPP11 E operator ^= (E &lhs, E rhs){\
      
../../../../../../../objectbox/src/main/cpp/external/flatbuffers/flatbuffers.h:270:5: note: in definition of macro 'FLATBUFFERS_DEFINE_BITMASK_OPERATORS'
     }\
     ^~
     inline FLATBUFFERS_CONSTEXPR_CPP11 E operator ^= (E &lhs, E rhs){\
      
../../../../../../../objectbox/src/main/cpp/user/user_generated.h: In function 'constexpr objectbox::UserFlags objectbox::operator^=(objectbox::UserFlags&, objectbox::UserFlags)':
../../../../../../../objectbox/src/main/cpp/external/flatbuffers/flatbuffers.h:274:5: error: body of 'constexpr' function 'constexpr objectbox::UserFlags objectbox::operator^=(objectbox::UserFlags&, objectbox::UserFlags)' not a return-statement
     }\
     ^~
     inline FLATBUFFERS_CONSTEXPR_CPP11 bool operator !(E rhs) \
      
../../../../../../../objectbox/src/main/cpp/external/flatbuffers/flatbuffers.h:274:5: note: in definition of macro 'FLATBUFFERS_DEFINE_BITMASK_OPERATORS'
     }\
     ^~
     inline FLATBUFFERS_CONSTEXPR_CPP11 bool operator !(E rhs) \
      

Metadata

Metadata

Assignees

Labels

flatcFlatBuffers Compiler

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions