[PATCH] D133853: [AST] Add msvc-specific C++11 attributes

H. Vetinari via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 21 03:34:32 PDT 2022


h-vetinari added a comment.

In D133853#3797598 <https://reviews.llvm.org/D133853#3797598>, @RIscRIpt wrote:

> I am afraid it would take me some effort to implement semantics of `[[msvc::no_unique_address]]`, so I'd like to focus only on `[[msvc::constexpr]]` in current patch.

Just for context, `[[msvc::no_unique_address]]` is 100% <https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/#c20-no_unique_address> like the standardized `[[no_unique_address]]`, but MSFT was... exceedingly cautious... about introducing this, as - even for an explicitly opt-in new feature - someone might have compiled code containing `[[no_unique_address]]` at a time when it was a no-op in their compiler (as an unknown attribute), and changing the semantics after the fact would have violated their very strict compatibility guarantees.

I assume the reasoning behind `[[msvc::constexpr]]` to be along the same lines.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133853



More information about the cfe-commits mailing list