Skip to content

WIP: Temporary clang fix for LHCb nightlies, NOT TO BE MERGED

Christoph Hasse requested to merge chasse/Gaudi:tmpClangFix into master

This MR introduces a little workaround to avoid the crash in the optimized clang builds.

When investigating this crash, I noticed that the clang version we use in the nightlies (clang-5.0.0) provided by sft is actually not the final release version but a previous tag clang version 5.0.0 (trunk 296300)

When building Gaudi with clang-3.9 there are no errors observed.
And a minimal example which reproduces the crash:

#include <cxxabi.h>
#include <iostream>
#include <regex>

int main()
{

  std::string realname("My amazing string with trailing whitespace ");

  std::string ret = std::regex_replace(
      realname.data(), std::regex{"My amazing string with trailing whitespace ?"},
      "std::string" );

  std::cout << ret << std::endl;
}

Will work when compiled with gcc, clang-3.9 or the final clang-5 release on my local machine. But when building this example with the provided clang-5.0.0 (lcg-clang++-5.0.0 -O2 -g -std=c++14 test.cpp -o crash) it will segault like we see in the nightlies.

Therefore this MR is only meant to stick around until we get a release version of clang-5.

@clemenci FYI

Merge request reports