From 5000f8bd123a87ffbc321a7e3fed61221c9a4da1 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 27 Jul 2023 10:50:46 -0400 Subject: DRTVWR-587: Try to work around clang bug. --- indra/llcommon/lazyeventapi.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'indra/llcommon/lazyeventapi.h') diff --git a/indra/llcommon/lazyeventapi.h b/indra/llcommon/lazyeventapi.h index e2dec8f35b..cc566e35af 100644 --- a/indra/llcommon/lazyeventapi.h +++ b/indra/llcommon/lazyeventapi.h @@ -72,21 +72,24 @@ namespace LL // Use connect_extended() so the lambda is passed its own // connection. + // apply() can't accept a template per se; it needs a particular + // specialization. Specialize out here to work around a clang bug: + // https://github.com/llvm/llvm-project/issues/41999 + auto func{ &LazyEventAPIBase::add_trampoline + }; + // We can't bind an unexpanded parameter pack into a lambda -- // shame really. Instead, capture all our args as a std::tuple and // then, in the lambda, use apply() to pass to add_trampoline(). mParams.init.connect_extended( - [args = std::make_tuple(name, desc, std::forward(rest)...)] + [func, args = std::make_tuple(name, desc, std::forward(rest)...)] (const boost::signals2::connection& conn, LLEventAPI* instance) { // we only need this connection once conn.disconnect(); // apply() expects a tuple specifying ALL the arguments, // so prepend instance. - // apply() can't accept a template per se; it needs a - // particular specialization. - apply(&LazyEventAPIBase::add_trampoline, - std::tuple_cat(std::make_tuple(instance), args)); + apply(func, std::tuple_cat(std::make_tuple(instance), args)); }); } -- cgit v1.2.3