zoecarver added a comment.

So, as I mentioned in the description of this patch, the reason that these 
members are treated as definitions is that Clang implicitly marks them as 
inline when targeting MS. This is sort of interesting a) because it only 
applies to constexpr vars, and b) because this also happens on all platforms 
for `std=c++17`. This means that the following program will compile 
successfully with `std=c++17`:

  template <class T>
  struct GetTypeValue {
    static constexpr const bool value = T::value;
  };
  
  using Invalid = GetTypeValue<int>;

However, if the `constexpr` is removed, it will fail to compile. Conversely, 
after this patch is applied, that will not happen on Windows (it will fail to 
compile regardless of the targeted standard or constexprness). I think it would 
make sense to "fix" this for `std=c++17` as well, but I'm not sure if that's in 
line with the standard.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98904

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

Reply via email to