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

Change stringify utility to avoid a compiler bug in GitLab/CI

This is strange, I cannot reproduce this compilation issue using
various installations of clang-10 ...
parent 5c1cb487
No related branches found
No related tags found
1 merge request!144Add R^dxd and R^d expressions in pugs' language (with d=1,2 or 3)
...@@ -98,7 +98,11 @@ class AffectationExecutor final : public IAffectationExecutor ...@@ -98,7 +98,11 @@ class AffectationExecutor final : public IAffectationExecutor
if constexpr (m_is_defined) { if constexpr (m_is_defined) {
auto stringify = [](auto&& value) { auto stringify = [](auto&& value) {
std::ostringstream os; std::ostringstream os;
if constexpr (std::is_same_v<std::decay_t<decltype(value)>, bool>) {
os << std::boolalpha << value; os << std::boolalpha << value;
} else {
os << value;
}
return os.str(); return os.str();
}; };
...@@ -445,7 +449,11 @@ class AffectationToTupleProcessor final : public AffectationToDataVariantProcess ...@@ -445,7 +449,11 @@ class AffectationToTupleProcessor final : public AffectationToDataVariantProcess
{ {
auto stringify = [](auto&& value) { auto stringify = [](auto&& value) {
std::ostringstream os; std::ostringstream os;
if constexpr (std::is_same_v<std::decay_t<decltype(value)>, bool>) {
os << std::boolalpha << value; os << std::boolalpha << value;
} else {
os << value;
}
return os.str(); return os.str();
}; };
...@@ -500,7 +508,11 @@ class AffectationToTupleFromListProcessor final : public AffectationToDataVarian ...@@ -500,7 +508,11 @@ class AffectationToTupleFromListProcessor final : public AffectationToDataVarian
{ {
auto stringify = [](auto&& value) { auto stringify = [](auto&& value) {
std::ostringstream os; std::ostringstream os;
if constexpr (std::is_same_v<std::decay_t<decltype(value)>, bool>) {
os << std::boolalpha << value; os << std::boolalpha << value;
} else {
os << value;
}
return os.str(); return os.str();
}; };
...@@ -563,7 +575,11 @@ class AffectationToTupleFromListProcessor final : public AffectationToDataVarian ...@@ -563,7 +575,11 @@ class AffectationToTupleFromListProcessor final : public AffectationToDataVarian
{ {
auto stringify = [](auto&& value) { auto stringify = [](auto&& value) {
std::ostringstream os; std::ostringstream os;
if constexpr (std::is_same_v<std::decay_t<decltype(value)>, bool>) {
os << std::boolalpha << value; os << std::boolalpha << value;
} else {
os << value;
}
return os.str(); return os.str();
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment