diff --git a/.evergreen/compile.sh b/.evergreen/compile.sh index ef1d3e685e..a9d0746c4d 100755 --- a/.evergreen/compile.sh +++ b/.evergreen/compile.sh @@ -155,7 +155,13 @@ darwin*) ;; linux*) cc_flags+=("${cc_flags_init[@]}") - cxx_flags+=("${cxx_flags_init[@]}" -Wno-expansion-to-defined -Wno-missing-field-initializers) + cxx_flags+=("${cxx_flags_init[@]}" -Wno-missing-field-initializers) + + if [[ "${distro_id:?}" != rhel7* ]]; then + cxx_flags+=("-Wno-expansion-to-defined") + else + cxx_flags+=("-Wno-unused-parameter") # TODO: remove once C driver is upgraded to include fix of CDRIVER-5673. + fi ;; *) echo "unrecognized operating system ${OSTYPE:?}" 1>&2 diff --git a/.mci.yml b/.mci.yml index 49557bfbaf..f4f77f8394 100644 --- a/.mci.yml +++ b/.mci.yml @@ -2221,3 +2221,13 @@ buildvariants: display_name: silk tasks: - name: .silk + + - name: rhel79-compile + display_name: "RHEL 7.9 (gcc 4.8.5)" + expansions: + build_type: "Release" + BSONCXX_POLYFILL: impls + run_on: + - rhel79-small + tasks: + - name: compile_without_tests diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json.hpp index b20a49d0ff..385022b532 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json.hpp @@ -82,7 +82,7 @@ BSONCXX_API document::value BSONCXX_CALL from_json(stdx::string_view json); /// /// @throws bsoncxx::v_noabi::exception with error details if the conversion failed. /// -BSONCXX_API document::value BSONCXX_CALL operator""_bson(const char* json, size_t len); +BSONCXX_API document::value BSONCXX_CALL operator"" _bson(const char* json, size_t len); } // namespace v_noabi } // namespace bsoncxx @@ -92,7 +92,7 @@ namespace bsoncxx { using ::bsoncxx::v_noabi::from_json; using ::bsoncxx::v_noabi::to_json; -using ::bsoncxx::v_noabi::operator""_bson; +using ::bsoncxx::v_noabi::operator"" _bson; } // namespace bsoncxx diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/string_view.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/string_view.hpp index 5d8d62799f..26eebb4fe7 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/string_view.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/string_view.hpp @@ -438,7 +438,7 @@ class basic_string_view : bsoncxx::detail::equality_operators, bsoncxx::detail:: // Required to define this here for compatibility with C++14 and older. Can be removed in C++17 or // newer. template -const std::size_t basic_string_view::npos; +constexpr std::size_t basic_string_view::npos; using string_view = basic_string_view; diff --git a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp index 4085faa908..784d342554 100644 --- a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp +++ b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp @@ -99,7 +99,7 @@ document::value BSONCXX_CALL from_json(stdx::string_view json) { return document::value{buf, length, bson_free_deleter}; } -document::value BSONCXX_CALL operator""_bson(const char* str, size_t len) { +document::value BSONCXX_CALL operator"" _bson(const char* str, size_t len) { return from_json(stdx::string_view{str, len}); }