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

Richard Dzenis via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 8 11:52:28 PST 2023


================
@@ -5546,11 +5563,14 @@ static EvalStmtResult EvaluateStmt(StmtResult &Result, EvalInfo &Info,
   case Stmt::LabelStmtClass:
     return EvaluateStmt(Result, Info, cast<LabelStmt>(S)->getSubStmt(), Case);
 
-  case Stmt::AttributedStmtClass:
-    // As a general principle, C++11 attributes can be ignored without
-    // any semantic impact.
-    return EvaluateStmt(Result, Info, cast<AttributedStmt>(S)->getSubStmt(),
-                        Case);
+  case Stmt::AttributedStmtClass: {
+    const auto *AS = cast<AttributedStmt>(S);
+    const auto *SS = AS->getSubStmt();
+    MSConstexprContextRAII msConstexprContext(
----------------
RIscRIpt wrote:

Adjusted manually.

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


More information about the cfe-commits mailing list