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

Change construction of a 0 singleton as an R^d list

This is a work around a clang-10 bug
parent 1c3423be
No related branches found
No related tags found
1 merge request!54Feature/language coverage
......@@ -419,13 +419,16 @@ class AffectationToTupleProcessor final : public INodeProcessor
} else {
std::ostringstream os;
os << v << std::ends;
*m_lhs = std::vector{os.str()};
*m_lhs = std::vector<std::string>{os.str()};
}
} else if constexpr (std::is_same_v<ValueT, TinyVector<1>> and std::is_arithmetic_v<T>) {
*m_lhs = std::vector{TinyVector<1>{static_cast<double>(v)}};
} else if constexpr (is_tiny_vector_v<ValueT> and std::is_same_v<T, int64_t>) {
*m_lhs = std::vector<TinyVector<1>>{TinyVector<1>{static_cast<double>(v)}};
} else if constexpr (std::is_same_v<ValueT, TinyVector<2>> and std::is_same_v<T, int64_t>) {
Assert(v == 0);
*m_lhs = std::vector<ValueT>{zero};
*m_lhs = std::vector<TinyVector<2>>{TinyVector<2>{zero}};
} else if constexpr (std::is_same_v<ValueT, TinyVector<3>> and std::is_same_v<T, int64_t>) {
Assert(v == 0);
*m_lhs = std::vector<TinyVector<3>>{TinyVector<3>{zero}};
} else {
// LCOV_EXCL_START
throw ParseError("unexpected error: unexpected right hand side type in affectation", m_node.begin());
......
......@@ -127,6 +127,11 @@ let t :(R^2); t = (0);
)",
"t", (std::vector<TinyVector<2>>{TinyVector<2>{0, 0}}));
CHECK_AFFECTATION_RESULT(R"(
let t :(R^3); t = (0);
)",
"t", (std::vector<TinyVector<3>>{TinyVector<3>{0, 0, 0}}));
CHECK_AFFECTATION_RESULT(R"(
let x : R^1, x = 1;
let t :(R^1); t = (x,2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment