From e5a9ff757f94ec6f3fb62c8f2c8a9618fc6d63e2 Mon Sep 17 00:00:00 2001 From: Markus Junginger Date: Wed, 4 Feb 2026 14:34:55 +0100 Subject: [PATCH] flatbuffers.h: fix C++11 compilation (#8857) (#8858) This constexpr officially works only with C++14 (assignment to lhs, 2 statements) and actually broke some C++11 compilers --- include/flatbuffers/flatbuffers.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 87b271e7c..0d9b5cced 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -260,15 +260,15 @@ inline const char* flatbuffers_version_string() { inline FLATBUFFERS_CONSTEXPR_CPP11 E operator ~ (E lhs){\ return E(~T(lhs));\ }\ - inline FLATBUFFERS_CONSTEXPR_CPP11 E operator |= (E &lhs, E rhs){\ + inline FLATBUFFERS_CONSTEXPR_CPP14 E operator |= (E &lhs, E rhs){\ lhs = lhs | rhs;\ return lhs;\ }\ - inline FLATBUFFERS_CONSTEXPR_CPP11 E operator &= (E &lhs, E rhs){\ + inline FLATBUFFERS_CONSTEXPR_CPP14 E operator &= (E &lhs, E rhs){\ lhs = lhs & rhs;\ return lhs;\ }\ - inline FLATBUFFERS_CONSTEXPR_CPP11 E operator ^= (E &lhs, E rhs){\ + inline FLATBUFFERS_CONSTEXPR_CPP14 E operator ^= (E &lhs, E rhs){\ lhs = lhs ^ rhs;\ return lhs;\ }\