Skip to content

CXX-3088 fix build with GCC 4.8.5 #1194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .evergreen/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions .mci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename C, typename Tr>
const std::size_t basic_string_view<C, Tr>::npos;
constexpr std::size_t basic_string_view<C, Tr>::npos;

using string_view = basic_string_view<char>;

Expand Down
2 changes: 1 addition & 1 deletion src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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});
}

Expand Down