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

Rewrite a few constexpr conditions as a workaround a clang's bug

parent 2ced7e2c
No related branches found
No related tags found
1 merge request!71Feature/language tiny matrices
This commit is part of merge request !71. Comments created here will be created in the context of that merge request.
......@@ -614,10 +614,12 @@ class AffectationToTupleProcessor final : public INodeProcessor
os << v;
*m_lhs = std::vector<std::string>{os.str()};
}
} else if constexpr ((std::is_same_v<ValueT, TinyVector<1>> or
std::is_same_v<ValueT, TinyMatrix<1>>)and std::is_arithmetic_v<T>) {
*m_lhs = std::vector<ValueT>{ValueT{static_cast<double>(v)}};
} else if constexpr ((is_tiny_vector_v<ValueT> or is_tiny_matrix_v<ValueT>)and std::is_same_v<T, int64_t>) {
} else if constexpr (is_tiny_vector_v<ValueT> or is_tiny_matrix_v<ValueT>) {
if constexpr (std::is_same_v<ValueT, TinyVector<1>> and std::is_arithmetic_v<T>) {
*m_lhs = std::vector<TinyVector<1>>{TinyVector<1>{static_cast<double>(v)}};
} else if constexpr (std::is_same_v<ValueT, TinyMatrix<1>> and std::is_arithmetic_v<T>) {
*m_lhs = std::vector<TinyMatrix<1>>{TinyMatrix<1>{static_cast<double>(v)}};
} else if constexpr (std::is_same_v<T, int64_t>) {
Assert(v == 0);
*m_lhs = std::vector<ValueT>{ValueT{zero}};
} else {
......@@ -625,6 +627,11 @@ class AffectationToTupleProcessor final : public INodeProcessor
throw ParseError("unexpected error: unexpected right hand side type in affectation", m_node.begin());
// LCOV_EXCL_STOP
}
} else {
// LCOV_EXCL_START
throw ParseError("unexpected error: unexpected right hand side type in affectation", m_node.begin());
// LCOV_EXCL_STOP
}
},
value);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment