dev-cpp/clucence-2.3.3.4-r8 exposes several uses of std::binary_function in util/Equators.h. std::binary_function was deprecated in C++11 and finally removed from the standard in C++17 [1]. While current versions of GCC/libstdc++ still seem to be providing this deprecated/removed template, Clang-15/libcxx no longer do, and thus packages using Clucene fail, for example libreoffice: -----8<------------------------------------------------------ In file included from /var/tmp/portage/app-office/libreoffice-7.3.5.2/work/libreoffice-7.3.5.2/helpcompiler/source/LuceneHelper.cxx:10: In file included from /var/tmp/portage/app-office/libreoffice-7.3.5.2/work/libreoffice-7.3.5.2/helpcompiler/source/LuceneHelper.hxx:17: In file included from /usr/include/CLucene.h:12: In file included from /usr/include/CLucene/index/IndexReader.h:12: In file included from /usr/include/CLucene/util/VoidList.h:10: /usr/include/CLucene/util/Equators.h:25:53: error: no template named 'binary_function' in namespace 'std'; did you mean '__binary_function'? class CLUCENE_INLINE_EXPORT Int32:public CL_NS_STD(binary_function)<const int32_t*,const int32_t*,bool> ~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/CLucene/SharedHeader.h:109:33: note: expanded from macro 'CL_NS_STD' #define CL_NS_STD(func) std::func ~~~~~^ /usr/include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>; ^ -----8<------------------------------------------------------ While the package probably still builds fine with current versions of GCC, I would expect GCC to follow suit at some point and no longer provide things removed from C++17, so I think this should be fixed even though I'm using a highly experimental, unsupported setup. [1] https://en.cppreference.com/w/cpp/utility/functional/binary_function Reproducible: Always Steps to Reproduce: 1. Switch to Clang-15 with libcxx as build toolchain 2. Try to build app-office/libreoffice Actual Results: Clucene headers can no longer be used with Clang-15 and libcxx. Expected Results: Clucene should be usable with Clang-15 and libcxx.
Created attachment 803950 [details] emerge.info
Created attachment 858825 [details, diff] remoe-binary-function.patch With clang-16, Clucene itself no longer builds for the same reason of using std::binary_function, most likely because the default language standard was bumped to C++17. So it's no longer just about exposing deprecated language features in public headers. Attached patch fixes the issues for me. It's my understanding that std::binary_function (and std::unary_function, for that matter) can just be removed in modern versions of C++.
Same error with clang-17, see https://github.com/gentoo/gentoo/pull/30547
As a workaround, you can add -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES or -stdlib=libstdc++ to CXXFLAGS while building clucene.
(In reply to Seryoga Leshii from comment #4) > As a workaround, you can add -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES or > -stdlib=libstdc++ to CXXFLAGS while building clucene. Thank you! This got inkscape working for me too with clang 16 :D
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ba9c12d6ed1d6054c055bea8480e2d0132ae8eb commit 1ba9c12d6ed1d6054c055bea8480e2d0132ae8eb Author: LinuxUserGD <hugegameartgd@gmail.com> AuthorDate: 2023-04-10 22:01:01 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-06-28 21:13:55 +0000 dev-cpp/clucene: fix removed std::binary_function in c++17 Closes: https://bugs.gentoo.org/853298 Closes: https://bugs.gentoo.org/869170 Signed-off-by: LinuxUserGD <hugegameartgd@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/30547 Signed-off-by: Sam James <sam@gentoo.org> ...2.3.3.4-r8.ebuild => clucene-2.3.3.4-r9.ebuild} | 1 + .../clucene-2.3.3.4-fix-binary-function.patch | 199 +++++++++++++++++++++ 2 files changed, 200 insertions(+)