[PATCH] D60912: MS ABI: handle inline static data member as template static data member

Jennifer Yu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 19 13:54:23 PDT 2019


jyu2 added a comment.

In D60912#1472987 <https://reviews.llvm.org/D60912#1472987>, @rnk wrote:

> In D60912#1472986 <https://reviews.llvm.org/D60912#1472986>, @jyu2 wrote:
>
> > inline static int aoo = foo(); // C++17 inline variable, thus also a definition
>
>
> This is a `static inline` global variable, so it technically creates two different globals, so calling foo twice is intended behavior. I think we really want to look at the GVA linkage instead of trying to list all the reasons why something might have weak linkage. Take a look at `shouldBeInCOMDAT` in CodeGenModule.cpp, I think it has the logic we want.


Yes, that is good.  I will do that way.  Thanks.  
Jennifer


Repository:
  rC Clang

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

https://reviews.llvm.org/D60912





More information about the cfe-commits mailing list