Closed balay closed 9 months ago
We narrowed now the problem to the way different compilers interpret the C++ standard.
The correct interpretation is not immediately obvious, older compilers have one behavior, newer ones act in a different way.
#include <iostream>
#include <memory>
struct B {
virtual ~B() = default;
virtual void foo() const = 0;
};
struct D : public B {
void foo() const override {}
};
template<class T>
void bar(T) { std::cout << "bar(T)\n"; }
template<class T>
void bar(T const&) { std::cout << "bar(T const&)\n"; }
int main(int, char**)
{
std::unique_ptr<B> p = std::make_unique<D>();
// ok with gcc (all versions) and clang (versions <= 16)
// ok with msvc (versions <= 19.24)
// ambiguous call with msvc (>= 19.25) and clang 17
bar(*p);
return 0;
}
Added a patch to fix the problem
Thanks! The build goes through now.
https://gitlab.com/xsdk-project/spack-xsdk/-/jobs/5291324290
Great! We can close the issue.
xr_l_c170-xsdk-100-linux-clang1700
https://gitlab.com/xsdk-project/spack-xsdk/-/jobs/5276299108
spack-build-out.txt