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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 7 06:53:28 PST 2023


================
@@ -2884,6 +2884,12 @@ def warn_cxx11_compat_constexpr_body_multiple_return : Warning<
   InGroup<CXXPre14Compat>, DefaultIgnore;
 def note_constexpr_body_previous_return : Note<
   "previous return statement is here">;
+def err_ms_constexpr_not_distinct : Error<
+  "[[msvc::constexpr]] cannot be applied to a %select{constexpr|consteval}0 function %1">;
+def err_ms_constexpr_virtual : Error<"virtual function cannot be [[msvc::constexpr]]">;
----------------
erichkeane wrote:

This diagnostic isn't particularly well worded, and, IMO, would be suited by just adding `virtual` to the select in the diagnostic on 2887.

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


More information about the cfe-commits mailing list