Skip to content
Snippets Groups Projects
Commit 69e77dce authored by Administrator's avatar Administrator
Browse files

Fix clang compilation error

The used structured bindings are only supported with C++20 and even then there
is a bug in clang with some older version which crash during compilation. The
fix doesn't capture the structured binding.
parent 3d61a7c2
No related branches found
No related tags found
1 merge request!1470Fix clang compilation error
Pipeline #25322 passed
......@@ -184,8 +184,17 @@ namespace cbm::algo
std::vector<fles::MicrosliceDescriptor> msDesc; // microslice descriptors
std::vector<const u8*> msContent; // pointer to microslice content
auto legalEqIds = GetEqIds(algos);
auto [numMs, sizeBytes] =
// Workaround a problem for some clang versions
// Capturing structured bindings either is avaialable with C++20
// Obviously GCC supports it already and has no problems but clang or at
// least some clang versions fail during compilation
// auto [numMs, sizeBytes] =
// ParallelInit(ts, subsystem, gsl::make_span(legalEqIds), sys_ver, genericMonitor, msEqIds, msDesc, msContent);
std::pair<size_t, size_t> tmp =
ParallelInit(ts, subsystem, gsl::make_span(legalEqIds), sys_ver, genericMonitor, msEqIds, msDesc, msContent);
auto numMs = tmp.first;
auto sizeBytes = tmp.second;
std::vector<std::vector<Digi>> msDigis(numMs); // unpacked digis per microslice
std::vector<Monitor> monitor(numMs); // unpacking monitoring data per microslice
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment