Open llvmbot opened 3 years ago
Reduced testcase:
template<typename T> struct wrap {
wrap(int) {}
~wrap() {}
};
template<typename T> void f(wrap<int> *a) { *a = { 0 }; }
int main() { f<void>(nullptr); }
I imagine we're not properly rebuilding a non-dependent RHS of an assignment expression during template instantiation (perhaps because we transform it as an expression rather than as an initializer).
Extended Description
this is a pretty specific bug, probably due to the explicit instantiation:
when having an initialisation list for a
std::map<something1, std::tuple<something2, std::vector<something3>>>
inside an explicitly instantiated function, there is a failure of type:Undefined symbols for architecture x86_64:
std::__1::allocator<unsigned long> > >::~tuple()
there is no reason why the attached code should fail to compile, and it actually works on gcc.
note: -remove the explicit instantiation and it works -replace the vector by a simple type like
int
and it works -remove the map and it worksI used
clang++ -std=c++17 ./clangbug.cpp
sorry I'm new here let me know if anything else is needed