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

Richard Dzenis via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 7 14:31:01 PST 2023


================
@@ -2861,8 +2861,8 @@ def warn_cxx17_compat_constexpr_local_var_no_init : Warning<
   "is incompatible with C++ standards before C++20">,
   InGroup<CXXPre20Compat>, DefaultIgnore;
 def ext_constexpr_function_never_constant_expr : ExtWarn<
-  "%select{constexpr|consteval}1 %select{function|constructor}0 never produces a "
-  "constant expression">, InGroup<DiagGroup<"invalid-constexpr">>, DefaultError;
+  "%select{constexpr|consteval|[[msvc::constexpr]]}1 %select{function|constructor}0 "
----------------
RIscRIpt wrote:

As you raised concern about `[[` `]]`, and after I saw automatic diagnostic when I changed Subjects to include ReturnStmt, I decided to use `constexpr` variant in my cases. Let me know if we can do better here.

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


More information about the cfe-commits mailing list