clang++-16 has moved to gnu++17 as a default, which takes out the definition of unexpected_handler in include/c++/v1/exception. The diff below lets me build libobjc2 using llvm-16.
ok? Index: Makefile =================================================================== RCS file: /home/cvs/ports/x11/gnustep/libobjc2/Makefile,v diff -u -p -r1.31 Makefile --- Makefile 10 Dec 2022 20:22:09 -0000 1.31 +++ Makefile 10 Nov 2023 15:14:50 -0000 @@ -9,7 +9,7 @@ GH_PROJECT = libobjc2 GH_TAGNAME = v${VERSION} DISTNAME = libobjc2-${VERSION:S/_//} PKGNAME = gnustep-${DISTNAME} -REVISION = 6 +REVISION = 7 SHARED_LIBS += objc2 1.1 SHARED_LIBS += objcxx 0.0 Index: patches/patch-objcxx_eh_cc =================================================================== RCS file: patches/patch-objcxx_eh_cc diff -N patches/patch-objcxx_eh_cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-objcxx_eh_cc 10 Nov 2023 15:20:12 -0000 @@ -0,0 +1,32 @@ +Fix build with llvm-16: +/usr/ports/pobj/gnustep-libobjc2-1.8.1/libobjc2-1.8.1/objcxx_eh.cc:76:2: error: unknown type name 'unexpected_handler' + unexpected_handler unexpectedHandler; + +https://github.com/gnustep/libobjc2/commit/0ae4e4ceb77410c619bf597d6f0b0842d5f078a6 + +Index: objcxx_eh.cc +--- objcxx_eh.cc.orig ++++ objcxx_eh.cc +@@ -2,7 +2,6 @@ + #include <stdio.h> + #include "dwarf_eh.h" + #include "objcxx_eh.h" +-#include <exception> + + extern "C" + { +@@ -14,6 +13,14 @@ namespace __cxxabiv1 + } + + using __cxxabiv1::__class_type_info; ++ ++// Define some C++ ABI types here, rather than including them. This prevents ++// conflicts with the libstdc++ headers, which expose only a subset of the ++// type_info class (the part required for standards compliance, not the ++// implementation details). ++ ++typedef void (*unexpected_handler)(); ++typedef void (*terminate_handler)(); + + namespace std + { -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE