From c75845b1ef01d76379bcc0a6937f1ca678484c68 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 18 Nov 2024 06:19:06 +1100 Subject: 3rdparty/sol2: Fixed build with clang 19. sol::optional::emplace was broken, and depended on the compiler not checking that members exist if the template wasn't instantiated. See ThePHD/sol2#1606 and ThePHD/sol2#1648. --- 3rdparty/sol2/sol/sol.hpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/3rdparty/sol2/sol/sol.hpp b/3rdparty/sol2/sol/sol.hpp index 1a9375d996d..04fd7e4958d 100644 --- a/3rdparty/sol2/sol/sol.hpp +++ b/3rdparty/sol2/sol/sol.hpp @@ -6747,12 +6747,9 @@ namespace sol { /// one. /// /// \group emplace - template - T& emplace(Args&&... args) noexcept { - static_assert(std::is_constructible::value, "T must be constructible with Args"); - - *this = nullopt; - this->construct(std::forward(args)...); + T& emplace(T& arg) noexcept { + m_value = &arg; + return **this; } /// Swaps this optional with the other. -- cgit v1.2.3