>  namespace test17 {
> -  // CHECK-DAG: @_ZZN6test173fooILi42EEEPivE3bar = weak_odr
> +  // CHECK-DAG: @_ZZN6test173fooILi42EEEPivE3bar = linkonce_odr
>    // CHECK-DAG: define weak_odr i32* @_ZN6test173fooILi42EEEPiv(
>    template<int I>
>    int *foo() {


Thanks!

I was about to reply saying that this change was wrong for explicit
templates instantiations, but it is actually correct:

* When we have a definition, the function is emitted as weak_odr, the
static variable as linkonce_odr, so the variable may be discarded.

* When we have a declaration, the function is declare, and the
variable is not even mentioned, so it is OK if it is discarded in the
other translation unit.

Cheers,
Rafael
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to