diff --git a/devel/sol2/Makefile b/devel/sol2/Makefile index 5add3e1ba977..cf0a23a4465e 100644 --- a/devel/sol2/Makefile +++ b/devel/sol2/Makefile @@ -1,30 +1,35 @@ PORTNAME= sol2 DISTVERSIONPREFIX= v DISTVERSION= 4.0.0-alpha -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MAINTAINER= yuri@FreeBSD.org COMMENT= C++ header-only library binding to Lua WWW= https://github.com/ThePhD/sol2 LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE.txt USES= cmake:testing compiler:c++17-lang lua:run USE_GITHUB= yes GH_ACCOUNT= ThePhD CMAKE_TESTING_ON= SOL2_TESTS NO_ARCH= yes .include .if ${CHOSEN_COMPILER_TYPE} == clang && \ ${COMPILER_VERSION} >= 180 && ${COMPILER_VERSION} < 190 EXTRA_PATCHES= ${PATCHDIR}/extra-patch-include_sol_function__types__stateless.hpp .endif +.if ${CHOSEN_COMPILER_TYPE} == clang && \ + ${COMPILER_VERSION} >= 191 +EXTRA_PATCHES= ${PATCHDIR}/extra-patch-include_sol_optional__implementation.hp +.endif + .include diff --git a/devel/sol2/files/extra-patch-include_sol_optional__implementation.hpp b/devel/sol2/files/extra-patch-include_sol_optional__implementation.hpp new file mode 100644 index 000000000000..809f9ae51cf1 --- /dev/null +++ b/devel/sol2/files/extra-patch-include_sol_optional__implementation.hpp @@ -0,0 +1,12 @@ +--- include/sol/optional_implementation.hpp.orig 2024-12-13 07:59:32 UTC ++++ include/sol/optional_implementation.hpp +@@ -2191,7 +2191,8 @@ namespace sol { + static_assert(std::is_constructible::value, "T must be constructible with Args"); + + *this = nullopt; +- this->construct(std::forward(args)...); ++ new (static_cast(this)) optional(std::in_place, std::forward(args)...); ++ return **this; + } + + /// Swaps this optional with the other.