labath added a comment.

> I don't have a way to write a C-based test for this as I don't know how to 
> craft a user expression in C that will make such a thing. I asked around a 
> bit and nobody had an easy way to do this.

Grepping clang's tests for `weak_odr` was very educational. The most portable 
way to produce this linkage seems to be:

  template<typename T> void f() {}
  template void f<int>();

As for whether this patch is correct -- I don't know. The weak_odr functions 
are allowed to be replaced (that's the `weak` part), but the replacement is 
supposed to be equivalent (the `odr` part). So, strictly speaking, it may be ok 
to just export this function, but if we wanted to be closer to what happens for 
realz, we should check first if there isn't a more definitive version available 
elsewhere...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78972/new/

https://reviews.llvm.org/D78972



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to