Skip to content
Snippets Groups Projects
Commit da1c135b authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Implement a workaround to satisfy clang

Looks like clang is unable to handle this constexpr "and" condition. Splitting
it fixes the problem.

I was not able to create a simple reproducer to report it to the clang team...
parent da3104b6
No related branches found
No related tags found
1 merge request!37Feature/language
......@@ -54,7 +54,7 @@ class BuiltinFunctionEmbedder : public IBuiltinFunctionEmbedder
_copy_value(ArgsTuple& t, const std::vector<DataVariant>& v) const
{
std::visit(
[&](auto v_i) {
[&](auto&& v_i) {
using Ti_Type = std::decay_t<decltype(std::get<I>(t))>;
using Vi_Type = std::decay_t<decltype(v_i)>;
......@@ -63,9 +63,13 @@ class BuiltinFunctionEmbedder : public IBuiltinFunctionEmbedder
} else if constexpr ((std::is_arithmetic_v<Vi_Type>)and(std::is_arithmetic_v<Ti_Type> or
std::is_same_v<Ti_Type, std::string>)) {
std::get<I>(t) = v_i;
} else if constexpr (is_shared_ptr_v<Ti_Type> and std::is_same_v<Vi_Type, EmbeddedData>) {
} else if constexpr (is_shared_ptr_v<Ti_Type>) {
if constexpr (std::is_same_v<Vi_Type, EmbeddedData>) {
auto data_handler = static_cast<const DataHandler<typename Ti_Type::element_type>&>(v_i.get());
std::get<I>(t) = data_handler.data_ptr();
} else {
throw std::runtime_error("unexpected argument types while casting: expecting EmbeddedData");
}
} else {
std::ostringstream os;
os << "unexpected argument types while casting " << demangle<Vi_Type>() << " -> " << demangle<Ti_Type>()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment