[clang] [clang-cl] Add support for [[msvc::constexpr]] C++11 attribute (PR #71300)

Richard Dzenis via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 9 02:28:52 PST 2023


RIscRIpt wrote:

Suggested commit message:
```
Add support for 'msvc::constexpr' C++11 attribute

This commit adds support for MSVC-specific C++11-style attribute
`[[msvc::constexpr]]`, which was added in MSVC 14.33.
The semantics of this attribute is enabled only under MSVC compatibility
(`-fms-compatibility-version`) 14.33 and higher.
Additionally, default value of `_MSC_VER` was raised to 1433.

The current implementation misses support of:
- `[[msvc::constexpr]]` constructors (see #72149);
  at the time of implementation such support required
  unreasonable amount of changes in Clang.
- `[[msvc::constexpr]] return ::new` (constexpr placement new) from
  non-std namespace (see #74924).

Relevant to: #57696
```

https://github.com/llvm/llvm-project/pull/71300


More information about the cfe-commits mailing list