[PATCH] D98904: Instantiate static constexpr data members on MS ABI.

Zoe Carver via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 18 17:34:12 PDT 2021


zoecarver added a comment.

> So. I think the status quo is OK but not great; we accept invalid code, in the name of MSVC compatibility, that MSVC doesn't accept. I don't think following MSVC would be a good thing, as that'd lead to our rejecting valid code (that MSVC also rejects but that we currently accept). If we can split the difference, and eagerly instantiate only in the case where the language rules say the variable is not inline but MSVC says it is inline, that would be an improvement, but it seems awkward as I think we've already lost the relevant information by the point we need to make the decision.

I agree. And, I think you're right about the fact that we've unfortunately lost the relevant info at the point. Even though it's a C++17 extension, someone could make `value` inline explicitly (as is done in your Godbolt) and we'd still error pre-c++17. Based on that, I'm going to close this for now. But if you (or someone else) thinks of another solution, or reason that it would be good to move forward with this, I'd be happy to re-open it and continue to work on it.

Thanks for all the help with this bug and patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98904



More information about the cfe-commits mailing list