Skip to content
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

Suppress warnings with latest Apple clang/libc++. #4486

Closed
wants to merge 3 commits into from

Conversation

HowardHinnant
Copy link
Contributor

There is a bad interaction between our empty_base_optimization and libc++'s obsolete implementation of std::equal_to. This involves the deprecated functions std::binary_function and std::unary_function.

This commit suppresses the warnings for the use of these functions on libc++, but has to call libc++-specific api (on libc++ only). This commit has no impact on platforms that do not use libc++.

These warnings do not appear until the upgrade to Apple clang version 14.0.3 (clang-1403.0.22.14.1).

High Level Overview of Change

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

There is a bad interaction between our empty_base_optimization
and libc++'s obsolete implementation of std::equal_to.  This involves
the deprecated functions std::binary_function and std::unary_function.

This commit suppresses the warnings for the use of these functions
on libc++, but has to call libc++-specific api (on libc++ only).
@@ -189,15 +187,13 @@ class aged_ordered_container
: public beast::detail::empty_base_optimization<Compare>
#ifdef _LIBCPP_VERSION
,
public std::binary_function<Key, element, bool>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would adding the double underscore do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This takes advantage of a libc++-only feature. std::binary_function is marked deprecated. But as an implementation technique of libc++, std::__binary_function has the same functionality as std::binary_function but is not marked deprecated. This is done as a hack in libc++ to avoid rewriting things that used to depend on std::binary_function but no longer do. And that hack is reused here in rippled.

If the hack goes away (libc++ comes into conformance), then we will get a compile-time error, and all we'll have to do is remove the code within #ifdef _LIBCPP_VERSION.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@gregtatcam
Copy link
Collaborator

Fails to build on OSX M1, Ventura 13.3.1, apple clang 14.0.0, conan 1.59.0, cmake 3.23.2:

[108/620] Building CXX object CMakeFiles/rippled.dir/src/test/beast/aged_associative_container_test.cpp.o
FAILED: CMakeFiles/rippled.dir/src/test/beast/aged_associative_container_test.cpp.o 
/Library/Developer/CommandLineTools/usr/bin/c++ -DBOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS -DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT -DBOOST_BEAST_ALLOW_DEPRECATED -DBOOST_CONTAINER_FWD_BAD_DEQUE -DBOOST_COROUTINES_NO_DEPRECATION_WARNING -DBOOST_FILESYSTEM_DEPRECATED -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=\"/usr/bin/addr2line\" -DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED -DBOOST_STACKTRACE_USE_ADDR2LINE -DBOOST_STACKTRACE_USE_BACKTRACE -DBOOST_STACKTRACE_USE_NOOP -DCARES_STATICLIB -DDATE_HEADER_ONLY -DENABLE_TESTS -DGIT_COMMIT_HASH=\"88fb82f2310a429539eedeaddc681e3017880563\" -DHAS_UNCAUGHT_EXCEPTIONS=1 -DOPENSSL_NO_SSL2 -DRIPPLE_ROCKSDB_AVAILABLE=1 -I/Users/user/rippled/src/ed25519-donna -I/Users/user/rippled/src -isystem /Users/user/.conan/data/boost/1.77.0/_/_/package/1d0a016ce7e6c6938e8520adf99dedeb1daa3ab8/include -isystem /Users/user/.conan/data/rocksdb/6.27.3/_/_/package/f53fce944771c44bbf9e7c43f3de47305563a53d/include -isystem /Users/user/.conan/data/snappy/1.1.9/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/lz4/1.9.3/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/openssl/1.1.1m/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/libarchive/3.6.0/_/_/package/a84fc8302cbdd736c4bcc2439b52beb5069d1317/include -isystem /Users/user/.conan/data/nudb/2.0.8/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -isystem /Users/user/rippled/build/proto_gen_grpc -isystem /Users/user/.conan/data/grpc/1.50.1/_/_/package/cf0163d58814b61d4cc7de6ddda8df85dee7f9d2/include -isystem /Users/user/.conan/data/abseil/20220623.0/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/c-ares/1.18.1/_/_/package/4a112ef69f20869073dceba40cb3f701cd7973d3/include -isystem /Users/user/.conan/data/re2/20220601/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/zlib/1.2.12/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/protobuf/3.21.4/_/_/package/62f9916ff46e8a0a640339df002086efa2cfb8d5/include -isystem /Users/user/rippled/build/proto_gen -isystem /Users/user/rippled/build/proto_gen/src/ripple/proto -isystem /Users/user/.conan/data/soci/4.0.3/_/_/package/5b07791c35dec035a2c09f0867975cd5fc1e4442/include -isystem /Users/user/.conan/data/libiconv/1.17/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/bzip2/1.0.8/_/_/package/fe6bc445938d37721aaee5d1131a84487f6d375f/include -isystem /Users/user/.conan/data/libbacktrace/cci.20210118/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/sqlite3/3.38.0/_/_/package/0dfeb5551b59e17cb4a748dbf8d7ed9f781a76d1/include -isystem /Users/user/.conan/data/date/3.0.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -stdlib=libc++ -Wall -Wdeprecated -Wextra -Wno-unused-parameter -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIE -frtti -Wnon-virtual-dtor -Wno-sign-compare -Wno-char-subscripts -Wno-format -Wno-unused-local-typedefs -fno-strict-aliasing -g -std=c++2a -MD -MT CMakeFiles/rippled.dir/src/test/beast/aged_associative_container_test.cpp.o -MF CMakeFiles/rippled.dir/src/test/beast/aged_associative_container_test.cpp.o.d -o CMakeFiles/rippled.dir/src/test/beast/aged_associative_container_test.cpp.o -c /Users/user/rippled/src/test/beast/aged_associative_container_test.cpp
In file included from /Users/user/rippled/src/test/beast/aged_associative_container_test.cpp:23:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_ordered_container.h:152:23: error: no template named '__binary_function' in namespace 'std'; did you mean 'binary_function'?
          public std::__binary_function<value_type, value_type, bool>
                 ~~~~~^~~~~~~~~~~~~~~~~
                      binary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/binary_function.h:22:29: note: 'binary_function' declared here
struct _LIBCPP_TEMPLATE_VIS binary_function
                            ^
In file included from /Users/user/rippled/src/test/beast/aged_associative_container_test.cpp:23:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_ordered_container.h:190:23: error: no template named '__binary_function' in namespace 'std'; did you mean 'binary_function'?
          public std::__binary_function<Key, element, bool>
                 ~~~~~^~~~~~~~~~~~~~~~~
                      binary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/binary_function.h:22:29: note: 'binary_function' declared here
struct _LIBCPP_TEMPLATE_VIS binary_function
                            ^
In file included from /Users/user/rippled/src/test/beast/aged_associative_container_test.cpp:27:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_unordered_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_unordered_container.h:154:35: error: no template named '__unary_function' in namespace 'std'; did you mean 'unary_function'?
                      public std::__unary_function<element, std::size_t>
                             ~~~~~^~~~~~~~~~~~~~~~
                                  unary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/unary_function.h:24:29: note: 'unary_function' declared here
struct _LIBCPP_TEMPLATE_VIS unary_function
                            ^
In file included from /Users/user/rippled/src/test/beast/aged_associative_container_test.cpp:27:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_unordered_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_unordered_container.h:195:23: error: no template named '__binary_function' in namespace 'std'; did you mean 'binary_function'?
          public std::__binary_function<Key, element, bool>
                 ~~~~~^~~~~~~~~~~~~~~~~
                      binary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/binary_function.h:22:29: note: 'binary_function' declared here
struct _LIBCPP_TEMPLATE_VIS binary_function
                            ^
4 errors generated.
[115/620] Building CXX object CMakeFiles/rippled.dir/src/test/consensus/Consensus_test.cpp.o
FAILED: CMakeFiles/rippled.dir/src/test/consensus/Consensus_test.cpp.o 
/Library/Developer/CommandLineTools/usr/bin/c++ -DBOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS -DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT -DBOOST_BEAST_ALLOW_DEPRECATED -DBOOST_CONTAINER_FWD_BAD_DEQUE -DBOOST_COROUTINES_NO_DEPRECATION_WARNING -DBOOST_FILESYSTEM_DEPRECATED -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=\"/usr/bin/addr2line\" -DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED -DBOOST_STACKTRACE_USE_ADDR2LINE -DBOOST_STACKTRACE_USE_BACKTRACE -DBOOST_STACKTRACE_USE_NOOP -DCARES_STATICLIB -DDATE_HEADER_ONLY -DENABLE_TESTS -DGIT_COMMIT_HASH=\"88fb82f2310a429539eedeaddc681e3017880563\" -DHAS_UNCAUGHT_EXCEPTIONS=1 -DOPENSSL_NO_SSL2 -DRIPPLE_ROCKSDB_AVAILABLE=1 -I/Users/user/rippled/src/ed25519-donna -I/Users/user/rippled/src -isystem /Users/user/.conan/data/boost/1.77.0/_/_/package/1d0a016ce7e6c6938e8520adf99dedeb1daa3ab8/include -isystem /Users/user/.conan/data/rocksdb/6.27.3/_/_/package/f53fce944771c44bbf9e7c43f3de47305563a53d/include -isystem /Users/user/.conan/data/snappy/1.1.9/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/lz4/1.9.3/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/openssl/1.1.1m/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/libarchive/3.6.0/_/_/package/a84fc8302cbdd736c4bcc2439b52beb5069d1317/include -isystem /Users/user/.conan/data/nudb/2.0.8/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -isystem /Users/user/rippled/build/proto_gen_grpc -isystem /Users/user/.conan/data/grpc/1.50.1/_/_/package/cf0163d58814b61d4cc7de6ddda8df85dee7f9d2/include -isystem /Users/user/.conan/data/abseil/20220623.0/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/c-ares/1.18.1/_/_/package/4a112ef69f20869073dceba40cb3f701cd7973d3/include -isystem /Users/user/.conan/data/re2/20220601/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/zlib/1.2.12/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/protobuf/3.21.4/_/_/package/62f9916ff46e8a0a640339df002086efa2cfb8d5/include -isystem /Users/user/rippled/build/proto_gen -isystem /Users/user/rippled/build/proto_gen/src/ripple/proto -isystem /Users/user/.conan/data/soci/4.0.3/_/_/package/5b07791c35dec035a2c09f0867975cd5fc1e4442/include -isystem /Users/user/.conan/data/libiconv/1.17/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/bzip2/1.0.8/_/_/package/fe6bc445938d37721aaee5d1131a84487f6d375f/include -isystem /Users/user/.conan/data/libbacktrace/cci.20210118/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/sqlite3/3.38.0/_/_/package/0dfeb5551b59e17cb4a748dbf8d7ed9f781a76d1/include -isystem /Users/user/.conan/data/date/3.0.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -stdlib=libc++ -Wall -Wdeprecated -Wextra -Wno-unused-parameter -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIE -frtti -Wnon-virtual-dtor -Wno-sign-compare -Wno-char-subscripts -Wno-format -Wno-unused-local-typedefs -fno-strict-aliasing -g -std=c++2a -MD -MT CMakeFiles/rippled.dir/src/test/consensus/Consensus_test.cpp.o -MF CMakeFiles/rippled.dir/src/test/consensus/Consensus_test.cpp.o.d -o CMakeFiles/rippled.dir/src/test/consensus/Consensus_test.cpp.o -c /Users/user/rippled/src/test/consensus/Consensus_test.cpp
In file included from /Users/user/rippled/src/test/consensus/Consensus_test.cpp:23:
In file included from /Users/user/rippled/src/test/csf.h:23:
In file included from /Users/user/rippled/src/test/csf/Peer.h:24:
In file included from /Users/user/rippled/src/ripple/consensus/Validations.h:27:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_unordered_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_unordered_container.h:154:35: error: no template named '__unary_function' in namespace 'std'; did you mean 'unary_function'?
                      public std::__unary_function<element, std::size_t>
                             ~~~~~^~~~~~~~~~~~~~~~
                                  unary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/unary_function.h:24:29: note: 'unary_function' declared here
struct _LIBCPP_TEMPLATE_VIS unary_function
                            ^
In file included from /Users/user/rippled/src/test/consensus/Consensus_test.cpp:23:
In file included from /Users/user/rippled/src/test/csf.h:23:
In file included from /Users/user/rippled/src/test/csf/Peer.h:24:
In file included from /Users/user/rippled/src/ripple/consensus/Validations.h:27:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_unordered_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_unordered_container.h:195:23: error: no template named '__binary_function' in namespace 'std'; did you mean 'binary_function'?
          public std::__binary_function<Key, element, bool>
                 ~~~~~^~~~~~~~~~~~~~~~~
                      binary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/binary_function.h:22:29: note: 'binary_function' declared here
struct _LIBCPP_TEMPLATE_VIS binary_function
                            ^
2 errors generated.
[116/620] Building CXX object CMakeFiles/rippled.dir/src/test/consensus/DistributedValidatorsSim_test.cpp.o
FAILED: CMakeFiles/rippled.dir/src/test/consensus/DistributedValidatorsSim_test.cpp.o 
/Library/Developer/CommandLineTools/usr/bin/c++ -DBOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS -DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT -DBOOST_BEAST_ALLOW_DEPRECATED -DBOOST_CONTAINER_FWD_BAD_DEQUE -DBOOST_COROUTINES_NO_DEPRECATION_WARNING -DBOOST_FILESYSTEM_DEPRECATED -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=\"/usr/bin/addr2line\" -DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED -DBOOST_STACKTRACE_USE_ADDR2LINE -DBOOST_STACKTRACE_USE_BACKTRACE -DBOOST_STACKTRACE_USE_NOOP -DCARES_STATICLIB -DDATE_HEADER_ONLY -DENABLE_TESTS -DGIT_COMMIT_HASH=\"88fb82f2310a429539eedeaddc681e3017880563\" -DHAS_UNCAUGHT_EXCEPTIONS=1 -DOPENSSL_NO_SSL2 -DRIPPLE_ROCKSDB_AVAILABLE=1 -I/Users/user/rippled/src/ed25519-donna -I/Users/user/rippled/src -isystem /Users/user/.conan/data/boost/1.77.0/_/_/package/1d0a016ce7e6c6938e8520adf99dedeb1daa3ab8/include -isystem /Users/user/.conan/data/rocksdb/6.27.3/_/_/package/f53fce944771c44bbf9e7c43f3de47305563a53d/include -isystem /Users/user/.conan/data/snappy/1.1.9/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/lz4/1.9.3/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/openssl/1.1.1m/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/libarchive/3.6.0/_/_/package/a84fc8302cbdd736c4bcc2439b52beb5069d1317/include -isystem /Users/user/.conan/data/nudb/2.0.8/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -isystem /Users/user/rippled/build/proto_gen_grpc -isystem /Users/user/.conan/data/grpc/1.50.1/_/_/package/cf0163d58814b61d4cc7de6ddda8df85dee7f9d2/include -isystem /Users/user/.conan/data/abseil/20220623.0/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/c-ares/1.18.1/_/_/package/4a112ef69f20869073dceba40cb3f701cd7973d3/include -isystem /Users/user/.conan/data/re2/20220601/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/zlib/1.2.12/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/protobuf/3.21.4/_/_/package/62f9916ff46e8a0a640339df002086efa2cfb8d5/include -isystem /Users/user/rippled/build/proto_gen -isystem /Users/user/rippled/build/proto_gen/src/ripple/proto -isystem /Users/user/.conan/data/soci/4.0.3/_/_/package/5b07791c35dec035a2c09f0867975cd5fc1e4442/include -isystem /Users/user/.conan/data/libiconv/1.17/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/bzip2/1.0.8/_/_/package/fe6bc445938d37721aaee5d1131a84487f6d375f/include -isystem /Users/user/.conan/data/libbacktrace/cci.20210118/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/sqlite3/3.38.0/_/_/package/0dfeb5551b59e17cb4a748dbf8d7ed9f781a76d1/include -isystem /Users/user/.conan/data/date/3.0.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -stdlib=libc++ -Wall -Wdeprecated -Wextra -Wno-unused-parameter -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIE -frtti -Wnon-virtual-dtor -Wno-sign-compare -Wno-char-subscripts -Wno-format -Wno-unused-local-typedefs -fno-strict-aliasing -g -std=c++2a -MD -MT CMakeFiles/rippled.dir/src/test/consensus/DistributedValidatorsSim_test.cpp.o -MF CMakeFiles/rippled.dir/src/test/consensus/DistributedValidatorsSim_test.cpp.o.d -o CMakeFiles/rippled.dir/src/test/consensus/DistributedValidatorsSim_test.cpp.o -c /Users/user/rippled/src/test/consensus/DistributedValidatorsSim_test.cpp
In file included from /Users/user/rippled/src/test/consensus/DistributedValidatorsSim_test.cpp:21:
In file included from /Users/user/rippled/src/test/csf.h:23:
In file included from /Users/user/rippled/src/test/csf/Peer.h:24:
In file included from /Users/user/rippled/src/ripple/consensus/Validations.h:27:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_unordered_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_unordered_container.h:154:35: error: no template named '__unary_function' in namespace 'std'; did you mean 'unary_function'?
                      public std::__unary_function<element, std::size_t>
                             ~~~~~^~~~~~~~~~~~~~~~
                                  unary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/unary_function.h:24:29: note: 'unary_function' declared here
struct _LIBCPP_TEMPLATE_VIS unary_function
                            ^
In file included from /Users/user/rippled/src/test/consensus/DistributedValidatorsSim_test.cpp:21:
In file included from /Users/user/rippled/src/test/csf.h:23:
In file included from /Users/user/rippled/src/test/csf/Peer.h:24:
In file included from /Users/user/rippled/src/ripple/consensus/Validations.h:27:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_unordered_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_unordered_container.h:195:23: error: no template named '__binary_function' in namespace 'std'; did you mean 'binary_function'?
          public std::__binary_function<Key, element, bool>
                 ~~~~~^~~~~~~~~~~~~~~~~
                      binary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/binary_function.h:22:29: note: 'binary_function' declared here
struct _LIBCPP_TEMPLATE_VIS binary_function
                            ^
2 errors generated.
[117/620] Building CXX object CMakeFiles/rippled.dir/src/test/consensus/ByzantineFailureSim_test.cpp.o
FAILED: CMakeFiles/rippled.dir/src/test/consensus/ByzantineFailureSim_test.cpp.o 
/Library/Developer/CommandLineTools/usr/bin/c++ -DBOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS -DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT -DBOOST_BEAST_ALLOW_DEPRECATED -DBOOST_CONTAINER_FWD_BAD_DEQUE -DBOOST_COROUTINES_NO_DEPRECATION_WARNING -DBOOST_FILESYSTEM_DEPRECATED -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=\"/usr/bin/addr2line\" -DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED -DBOOST_STACKTRACE_USE_ADDR2LINE -DBOOST_STACKTRACE_USE_BACKTRACE -DBOOST_STACKTRACE_USE_NOOP -DCARES_STATICLIB -DDATE_HEADER_ONLY -DENABLE_TESTS -DGIT_COMMIT_HASH=\"88fb82f2310a429539eedeaddc681e3017880563\" -DHAS_UNCAUGHT_EXCEPTIONS=1 -DOPENSSL_NO_SSL2 -DRIPPLE_ROCKSDB_AVAILABLE=1 -I/Users/user/rippled/src/ed25519-donna -I/Users/user/rippled/src -isystem /Users/user/.conan/data/boost/1.77.0/_/_/package/1d0a016ce7e6c6938e8520adf99dedeb1daa3ab8/include -isystem /Users/user/.conan/data/rocksdb/6.27.3/_/_/package/f53fce944771c44bbf9e7c43f3de47305563a53d/include -isystem /Users/user/.conan/data/snappy/1.1.9/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/lz4/1.9.3/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/openssl/1.1.1m/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/libarchive/3.6.0/_/_/package/a84fc8302cbdd736c4bcc2439b52beb5069d1317/include -isystem /Users/user/.conan/data/nudb/2.0.8/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -isystem /Users/user/rippled/build/proto_gen_grpc -isystem /Users/user/.conan/data/grpc/1.50.1/_/_/package/cf0163d58814b61d4cc7de6ddda8df85dee7f9d2/include -isystem /Users/user/.conan/data/abseil/20220623.0/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/c-ares/1.18.1/_/_/package/4a112ef69f20869073dceba40cb3f701cd7973d3/include -isystem /Users/user/.conan/data/re2/20220601/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/zlib/1.2.12/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/protobuf/3.21.4/_/_/package/62f9916ff46e8a0a640339df002086efa2cfb8d5/include -isystem /Users/user/rippled/build/proto_gen -isystem /Users/user/rippled/build/proto_gen/src/ripple/proto -isystem /Users/user/.conan/data/soci/4.0.3/_/_/package/5b07791c35dec035a2c09f0867975cd5fc1e4442/include -isystem /Users/user/.conan/data/libiconv/1.17/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/bzip2/1.0.8/_/_/package/fe6bc445938d37721aaee5d1131a84487f6d375f/include -isystem /Users/user/.conan/data/libbacktrace/cci.20210118/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/sqlite3/3.38.0/_/_/package/0dfeb5551b59e17cb4a748dbf8d7ed9f781a76d1/include -isystem /Users/user/.conan/data/date/3.0.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -stdlib=libc++ -Wall -Wdeprecated -Wextra -Wno-unused-parameter -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIE -frtti -Wnon-virtual-dtor -Wno-sign-compare -Wno-char-subscripts -Wno-format -Wno-unused-local-typedefs -fno-strict-aliasing -g -std=c++2a -MD -MT CMakeFiles/rippled.dir/src/test/consensus/ByzantineFailureSim_test.cpp.o -MF CMakeFiles/rippled.dir/src/test/consensus/ByzantineFailureSim_test.cpp.o.d -o CMakeFiles/rippled.dir/src/test/consensus/ByzantineFailureSim_test.cpp.o -c /Users/user/rippled/src/test/consensus/ByzantineFailureSim_test.cpp
In file included from /Users/user/rippled/src/test/consensus/ByzantineFailureSim_test.cpp:21:
In file included from /Users/user/rippled/src/test/csf.h:23:
In file included from /Users/user/rippled/src/test/csf/Peer.h:24:
In file included from /Users/user/rippled/src/ripple/consensus/Validations.h:27:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_unordered_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_unordered_container.h:154:35: error: no template named '__unary_function' in namespace 'std'; did you mean 'unary_function'?
                      public std::__unary_function<element, std::size_t>
                             ~~~~~^~~~~~~~~~~~~~~~
                                  unary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/unary_function.h:24:29: note: 'unary_function' declared here
struct _LIBCPP_TEMPLATE_VIS unary_function
                            ^
In file included from /Users/user/rippled/src/test/consensus/ByzantineFailureSim_test.cpp:21:
In file included from /Users/user/rippled/src/test/csf.h:23:
In file included from /Users/user/rippled/src/test/csf/Peer.h:24:
In file included from /Users/user/rippled/src/ripple/consensus/Validations.h:27:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_unordered_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_unordered_container.h:195:23: error: no template named '__binary_function' in namespace 'std'; did you mean 'binary_function'?
          public std::__binary_function<Key, element, bool>
                 ~~~~~^~~~~~~~~~~~~~~~~
                      binary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/binary_function.h:22:29: note: 'binary_function' declared here
struct _LIBCPP_TEMPLATE_VIS binary_function
                            ^
2 errors generated.
[119/620] Building CXX object CMakeFiles/rippled.dir/src/test/consensus/ScaleFreeSim_test.cpp.o
FAILED: CMakeFiles/rippled.dir/src/test/consensus/ScaleFreeSim_test.cpp.o 
/Library/Developer/CommandLineTools/usr/bin/c++ -DBOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS -DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT -DBOOST_BEAST_ALLOW_DEPRECATED -DBOOST_CONTAINER_FWD_BAD_DEQUE -DBOOST_COROUTINES_NO_DEPRECATION_WARNING -DBOOST_FILESYSTEM_DEPRECATED -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=\"/usr/bin/addr2line\" -DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED -DBOOST_STACKTRACE_USE_ADDR2LINE -DBOOST_STACKTRACE_USE_BACKTRACE -DBOOST_STACKTRACE_USE_NOOP -DCARES_STATICLIB -DDATE_HEADER_ONLY -DENABLE_TESTS -DGIT_COMMIT_HASH=\"88fb82f2310a429539eedeaddc681e3017880563\" -DHAS_UNCAUGHT_EXCEPTIONS=1 -DOPENSSL_NO_SSL2 -DRIPPLE_ROCKSDB_AVAILABLE=1 -I/Users/user/rippled/src/ed25519-donna -I/Users/user/rippled/src -isystem /Users/user/.conan/data/boost/1.77.0/_/_/package/1d0a016ce7e6c6938e8520adf99dedeb1daa3ab8/include -isystem /Users/user/.conan/data/rocksdb/6.27.3/_/_/package/f53fce944771c44bbf9e7c43f3de47305563a53d/include -isystem /Users/user/.conan/data/snappy/1.1.9/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/lz4/1.9.3/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/openssl/1.1.1m/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/libarchive/3.6.0/_/_/package/a84fc8302cbdd736c4bcc2439b52beb5069d1317/include -isystem /Users/user/.conan/data/nudb/2.0.8/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -isystem /Users/user/rippled/build/proto_gen_grpc -isystem /Users/user/.conan/data/grpc/1.50.1/_/_/package/cf0163d58814b61d4cc7de6ddda8df85dee7f9d2/include -isystem /Users/user/.conan/data/abseil/20220623.0/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/c-ares/1.18.1/_/_/package/4a112ef69f20869073dceba40cb3f701cd7973d3/include -isystem /Users/user/.conan/data/re2/20220601/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/zlib/1.2.12/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/protobuf/3.21.4/_/_/package/62f9916ff46e8a0a640339df002086efa2cfb8d5/include -isystem /Users/user/rippled/build/proto_gen -isystem /Users/user/rippled/build/proto_gen/src/ripple/proto -isystem /Users/user/.conan/data/soci/4.0.3/_/_/package/5b07791c35dec035a2c09f0867975cd5fc1e4442/include -isystem /Users/user/.conan/data/libiconv/1.17/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/bzip2/1.0.8/_/_/package/fe6bc445938d37721aaee5d1131a84487f6d375f/include -isystem /Users/user/.conan/data/libbacktrace/cci.20210118/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/sqlite3/3.38.0/_/_/package/0dfeb5551b59e17cb4a748dbf8d7ed9f781a76d1/include -isystem /Users/user/.conan/data/date/3.0.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -stdlib=libc++ -Wall -Wdeprecated -Wextra -Wno-unused-parameter -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIE -frtti -Wnon-virtual-dtor -Wno-sign-compare -Wno-char-subscripts -Wno-format -Wno-unused-local-typedefs -fno-strict-aliasing -g -std=c++2a -MD -MT CMakeFiles/rippled.dir/src/test/consensus/ScaleFreeSim_test.cpp.o -MF CMakeFiles/rippled.dir/src/test/consensus/ScaleFreeSim_test.cpp.o.d -o CMakeFiles/rippled.dir/src/test/consensus/ScaleFreeSim_test.cpp.o -c /Users/user/rippled/src/test/consensus/ScaleFreeSim_test.cpp
In file included from /Users/user/rippled/src/test/consensus/ScaleFreeSim_test.cpp:21:
In file included from /Users/user/rippled/src/test/csf.h:23:
In file included from /Users/user/rippled/src/test/csf/Peer.h:24:
In file included from /Users/user/rippled/src/ripple/consensus/Validations.h:27:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_unordered_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_unordered_container.h:154:35: error: no template named '__unary_function' in namespace 'std'; did you mean 'unary_function'?
                      public std::__unary_function<element, std::size_t>
                             ~~~~~^~~~~~~~~~~~~~~~
                                  unary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/unary_function.h:24:29: note: 'unary_function' declared here
struct _LIBCPP_TEMPLATE_VIS unary_function
                            ^
In file included from /Users/user/rippled/src/test/consensus/ScaleFreeSim_test.cpp:21:
In file included from /Users/user/rippled/src/test/csf.h:23:
In file included from /Users/user/rippled/src/test/csf/Peer.h:24:
In file included from /Users/user/rippled/src/ripple/consensus/Validations.h:27:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_unordered_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_unordered_container.h:195:23: error: no template named '__binary_function' in namespace 'std'; did you mean 'binary_function'?
          public std::__binary_function<Key, element, bool>
                 ~~~~~^~~~~~~~~~~~~~~~~
                      binary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/binary_function.h:22:29: note: 'binary_function' declared here
struct _LIBCPP_TEMPLATE_VIS binary_function
                            ^
2 errors generated.
[120/620] Building CXX object CMakeFiles/rippled.dir/src/test/consensus/NegativeUNL_test.cpp.o
FAILED: CMakeFiles/rippled.dir/src/test/consensus/NegativeUNL_test.cpp.o 
/Library/Developer/CommandLineTools/usr/bin/c++ -DBOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS -DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT -DBOOST_BEAST_ALLOW_DEPRECATED -DBOOST_CONTAINER_FWD_BAD_DEQUE -DBOOST_COROUTINES_NO_DEPRECATION_WARNING -DBOOST_FILESYSTEM_DEPRECATED -DBOOST_STACKTRACE_ADDR2LINE_LOCATION=\"/usr/bin/addr2line\" -DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED -DBOOST_STACKTRACE_USE_ADDR2LINE -DBOOST_STACKTRACE_USE_BACKTRACE -DBOOST_STACKTRACE_USE_NOOP -DCARES_STATICLIB -DDATE_HEADER_ONLY -DENABLE_TESTS -DGIT_COMMIT_HASH=\"88fb82f2310a429539eedeaddc681e3017880563\" -DHAS_UNCAUGHT_EXCEPTIONS=1 -DOPENSSL_NO_SSL2 -DRIPPLE_ROCKSDB_AVAILABLE=1 -I/Users/user/rippled/src/ed25519-donna -I/Users/user/rippled/src -isystem /Users/user/.conan/data/boost/1.77.0/_/_/package/1d0a016ce7e6c6938e8520adf99dedeb1daa3ab8/include -isystem /Users/user/.conan/data/rocksdb/6.27.3/_/_/package/f53fce944771c44bbf9e7c43f3de47305563a53d/include -isystem /Users/user/.conan/data/snappy/1.1.9/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/lz4/1.9.3/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/openssl/1.1.1m/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/libarchive/3.6.0/_/_/package/a84fc8302cbdd736c4bcc2439b52beb5069d1317/include -isystem /Users/user/.conan/data/nudb/2.0.8/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -isystem /Users/user/rippled/build/proto_gen_grpc -isystem /Users/user/.conan/data/grpc/1.50.1/_/_/package/cf0163d58814b61d4cc7de6ddda8df85dee7f9d2/include -isystem /Users/user/.conan/data/abseil/20220623.0/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/c-ares/1.18.1/_/_/package/4a112ef69f20869073dceba40cb3f701cd7973d3/include -isystem /Users/user/.conan/data/re2/20220601/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/zlib/1.2.12/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/protobuf/3.21.4/_/_/package/62f9916ff46e8a0a640339df002086efa2cfb8d5/include -isystem /Users/user/rippled/build/proto_gen -isystem /Users/user/rippled/build/proto_gen/src/ripple/proto -isystem /Users/user/.conan/data/soci/4.0.3/_/_/package/5b07791c35dec035a2c09f0867975cd5fc1e4442/include -isystem /Users/user/.conan/data/libiconv/1.17/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/bzip2/1.0.8/_/_/package/fe6bc445938d37721aaee5d1131a84487f6d375f/include -isystem /Users/user/.conan/data/libbacktrace/cci.20210118/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/sqlite3/3.38.0/_/_/package/0dfeb5551b59e17cb4a748dbf8d7ed9f781a76d1/include -isystem /Users/user/.conan/data/date/3.0.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -stdlib=libc++ -Wall -Wdeprecated -Wextra -Wno-unused-parameter -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIE -frtti -Wnon-virtual-dtor -Wno-sign-compare -Wno-char-subscripts -Wno-format -Wno-unused-local-typedefs -fno-strict-aliasing -g -std=c++2a -MD -MT CMakeFiles/rippled.dir/src/test/consensus/NegativeUNL_test.cpp.o -MF CMakeFiles/rippled.dir/src/test/consensus/NegativeUNL_test.cpp.o.d -o CMakeFiles/rippled.dir/src/test/consensus/NegativeUNL_test.cpp.o -c /Users/user/rippled/src/test/consensus/NegativeUNL_test.cpp
In file included from /Users/user/rippled/src/test/consensus/NegativeUNL_test.cpp:20:
In file included from /Users/user/rippled/src/ripple/app/consensus/RCLValidations.h:24:
In file included from /Users/user/rippled/src/ripple/consensus/Validations.h:27:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_unordered_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_unordered_container.h:154:35: error: no template named '__unary_function' in namespace 'std'; did you mean 'unary_function'?
                      public std::__unary_function<element, std::size_t>
                             ~~~~~^~~~~~~~~~~~~~~~
                                  unary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/unary_function.h:24:29: note: 'unary_function' declared here
struct _LIBCPP_TEMPLATE_VIS unary_function
                            ^
In file included from /Users/user/rippled/src/test/consensus/NegativeUNL_test.cpp:20:
In file included from /Users/user/rippled/src/ripple/app/consensus/RCLValidations.h:24:
In file included from /Users/user/rippled/src/ripple/consensus/Validations.h:27:
In file included from /Users/user/rippled/src/ripple/beast/container/aged_unordered_map.h:23:
/Users/user/rippled/src/ripple/beast/container/detail/aged_unordered_container.h:195:23: error: no template named '__binary_function' in namespace 'std'; did you mean 'binary_function'?
          public std::__binary_function<Key, element, bool>
                 ~~~~~^~~~~~~~~~~~~~~~~
                      binary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/binary_function.h:22:29: note: 'binary_function' declared here
struct _LIBCPP_TEMPLATE_VIS binary_function
                            ^
2 errors generated.
[123/620] Building CXX object CMakeFiles/rippled.dir/src/test/server/Server_test.cpp.o
ninja: build stopped: subcommand failed.

Include a transition from pre-hack to post-hack.
@HowardHinnant
Copy link
Contributor Author

Thanks for the detailed report @gregtatcam ! I didn't realize I needed a transition story across different versions of libc++. I've added this as a commit-to-be-merged. If you could rerun your test with this update I would be most grateful. I no longer have the version of libc++ you do, so I'm unable to test against it.

@gregtatcam
Copy link
Collaborator

Thanks for the detailed report @gregtatcam ! I didn't realize I needed a transition story across different versions of libc++. I've added this as a commit-to-be-merged. If you could rerun your test with this update I would be most grateful. I no longer have the version of libc++ you do, so I'm unable to test against it.

Sure, no problem. Getting these errors after the update:

/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/user/Work/Projects/rippled/build --target rippled -j 16
 [171/490] Building CXX object CMakeFiles/rippled.dir/src/ripple/app/ledger/impl/InboundLedgers.cpp.o
 FAILED: CMakeFiles/rippled.dir/src/ripple/app/ledger/impl/InboundLedgers.cpp.o
 /Library/Developer/CommandLineTools/usr/bin/c++ -DBOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS -DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT -             DBOOST_BEAST_ALLOW_DEPRECATED -DBOOST_CONTAINER_FWD_BAD_DEQUE -DBOOST_COROUTINES_NO_DEPRECATION_WARNING -DBOOST_FILESYSTEM_DEPRECATED -              DBOOST_STACKTRACE_ADDR2LINE_LOCATION=\"/usr/bin/addr2line\" -DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED -DBOOST_STACKTRACE_USE_ADDR2LINE -            DBOOST_STACKTRACE_USE_BACKTRACE -DBOOST_STACKTRACE_USE_NOOP -DCARES_STATICLIB -DDATE_HEADER_ONLY -DENABLE_TESTS -                                    DGIT_COMMIT_HASH=\"88fb82f2310a429539eedeaddc681e3017880563\" -DHAS_UNCAUGHT_EXCEPTIONS=1 -DOPENSSL_NO_SSL2 -DRIPPLE_ROCKSDB_AVAILABLE=1 -I/Users/   user/Work/Projects/rippled/src/ed25519-donna -I/Users/user/Work/Projects/rippled/src -isystem /Users/user/.conan/data/boost/1.77.0/_/_/package/      1d0a016ce7e6c6938e8520adf99dedeb1daa3ab8/include -isystem /Users/user/.conan/data/rocksdb/6.27.3/_/_/package/                                        f53fce944771c44bbf9e7c43f3de47305563a53d/include -isystem /Users/user/.conan/data/snappy/1.1.9/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/ include -isystem /Users/user/.conan/data/lz4/1.9.3/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/    openssl/1.1.1m/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/libarchive/3.6.0/_/_/package/           a84fc8302cbdd736c4bcc2439b52beb5069d1317/include -isystem /Users/user/.conan/data/nudb/2.0.8/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/   include -isystem /Users/user/Work/Projects/rippled/build/proto_gen_grpc -isystem /Users/user/.conan/data/grpc/1.50.1/_/_/package/                    cf0163d58814b61d4cc7de6ddda8df85dee7f9d2/include -isystem /Users/user/.conan/data/abseil/20220623.0/_/_/package/                                     f27fdbfe8e9fa31c497f49ea7bad54c34172b017/include -isystem /Users/user/.conan/data/c-ares/1.18.1/_/_/package/                                         4a112ef69f20869073dceba40cb3f701cd7973d3/include -isystem /Users/user/.conan/data/re2/20220601/_/_/package/f27fdbfe8e9fa31c497f49ea7bad54c34172b017/ include -isystem /Users/user/.conan/data/zlib/1.2.12/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/  protobuf/3.21.4/_/_/package/62f9916ff46e8a0a640339df002086efa2cfb8d5/include -isystem /Users/user/Work/Projects/rippled/build/proto_gen -isystem /   Users/user/Work/Projects/rippled/build/proto_gen/src/ripple/proto -isystem /Users/user/.conan/data/soci/4.0.3/_/_/package/                           5b07791c35dec035a2c09f0867975cd5fc1e4442/include -isystem /Users/user/.conan/data/libiconv/1.17/_/_/package/                                         82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/user/.conan/data/bzip2/1.0.8/_/_/package/fe6bc445938d37721aaee5d1131a84487f6d375f/  include -isystem /Users/user/.conan/data/libbacktrace/cci.20210118/_/_/package/82146580b4483a8651b14897b7c57cead95f4235/include -isystem /Users/     user/.conan/data/sqlite3/3.38.0/_/_/package/0dfeb5551b59e17cb4a748dbf8d7ed9f781a76d1/include -isystem /Users/user/.conan/data/date/3.0.1/_/_/        package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -stdlib=libc++ -Wall -Wdeprecated -Wextra -Wno-unused-parameter -O3 -DNDEBUG -arch arm64 -  isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIE -frtti -Wnon-virtual-dtor -Wno-sign-compare -Wno-char-subscripts -Wno-format -    Wno-unused-local-typedefs -fno-strict-aliasing -g -std=c++20 -MD -MT CMakeFiles/rippled.dir/src/ripple/app/ledger/impl/InboundLedgers.cpp.o -MF      CMakeFiles/rippled.dir/src/ripple/app/ledger/impl/InboundLedgers.cpp.o.d -o CMakeFiles/rippled.dir/src/ripple/app/ledger/impl/InboundLedgers.cpp.o - c /Users/user/Work/Projects/rippled/src/ripple/app/ledger/impl/InboundLedgers.cpp
 In file included from /Users/user/Work/Projects/rippled/src/ripple/app/ledger/impl/InboundLedgers.cpp:26:
 In file included from /Users/user/Work/Projects/rippled/src/ripple/beast/container/aged_map.h:23:
 /Users/user/Work/Projects/rippled/src/ripple/beast/container/detail/aged_ordered_container.h:152:23: error: no template named '__binary_function'    in namespace 'std'; did you mean 'binary_function'?
           public std::__binary_function<value_type, value_type, bool>
                  ~~~~~^~~~~~~~~~~~~~~~~
                       binary_function
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/binary_function.h:22:29: note: 'binary_function' declared here
 struct _LIBCPP_TEMPLATE_VIS binary_function
                             ^
 In file included from /Users/user/Work/Projects/rippled/src/ripple/app/ledger/impl/InboundLedgers.cpp:26:
 In file included from /Users/user/Work/Projects/rippled/src/ripple/beast/container/aged_map.h:23:
 /Users/user/Work/Projects/rippled/src/ripple/beast/container/detail/aged_ordered_container.h:190:23: error: no template named '__binary_function'    in namespace 'std'; did you mean 'binary_function'?
           public std::__binary_function<Key, element, bool>
                  ~~~~~^~~~~~~~~~~~~~~~~
                       binary_function
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__functional/binary_function.h:22:29: note: 'binary_function' declared here
 struct _LIBCPP_TEMPLATE_VIS binary_function
                             ^
 2 errors generated.
 [186/490] Building CXX object CMakeFiles/rippled.dir/src/ripple/app/ledger/impl/LedgerMaster.cpp.o
 ninja: build stopped: subcommand failed.

@HowardHinnant
Copy link
Contributor Author

Thanks @gregtatcam. I actually changed that file but neglected to hit save!

@gregtatcam
Copy link
Collaborator

Thanks @gregtatcam. I actually changed that file but neglected to hit save!

It builds now!

@HowardHinnant
Copy link
Contributor Author

Closing because @thejohnfreeman has a superior solution.

intelliot pushed a commit that referenced this pull request Apr 21, 2023
Address issues related to the removal of `std::{u,bi}nary_function` in
C++17 and some warnings with Clang 16. Some warnings appeared with the
upgrade to Apple clang version 14.0.3 (clang-1403.0.22.14.1).

- `std::{u,bi}nary_function` were removed in C++17. They were empty
  classes with a few associated types. We already have conditional code
  to define the types. Just make it unconditional.
- libc++ checks a cast in an unevaluated context to see if a type
  inherits from a binary function class in the standard library, e.g.
  `std::equal_to`, and this causes an error when the type privately
  inherits from such a class. Change these instances to public
  inheritance.
- We don't need a middle-man for the empty base optimization. Prefer to
  inherit directly from an empty class than from
  `beast::detail::empty_base_optimization`.
- Clang warns when all the uses of a variable are removed by conditional
  compilation of assertions. Add a `[[maybe_unused]]` annotation to
  suppress it.
- As a drive-by clean-up, remove commented code.

See related work in #4486.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants