[all-commits] [llvm/llvm-project] b3e6ff: [clang-cl] Add support for [[msvc::constexpr]] C++...

Richard Dzenis via All-commits all-commits at lists.llvm.org
Sat Dec 9 02:35:51 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b3e6ff331925dde24a4707452d657da0fdf7f588
      https://github.com/llvm/llvm-project/commit/b3e6ff331925dde24a4707452d657da0fdf7f588
  Author: Richard Dzenis <dzenis at richard.lv>
  Date:   2023-12-09 (Sat, 09 Dec 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/docs/UsersManual.rst
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Basic/AttrDocs.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Basic/LangOptions.h
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/Basic/Targets/OSTargets.cpp
    M clang/lib/Driver/ToolChains/MSVC.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    M clang/lib/Sema/SemaStmtAttr.cpp
    A clang/test/AST/ms-constexpr.cpp
    M clang/test/Driver/cl-options.c
    M clang/test/Misc/pragma-attribute-supported-attributes-list.test
    A clang/test/SemaCXX/ms-constexpr-invalid.cpp
    A clang/test/SemaCXX/ms-constexpr-new.cpp
    A clang/test/SemaCXX/ms-constexpr.cpp

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

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

The current implementation lacks support for:
- `[[msvc::constexpr]]` constructors (see #72149);
  at the time of this implementation, such support would have required
  an unreasonable number of changes in Clang.
- `[[msvc::constexpr]] return ::new` (constexpr placement new) from
  non-std namespaces (see #74924).

Relevant to: #57696




More information about the All-commits mailing list