This revision was automatically updated to reflect the committed changes.
Closed by commit rGded249049429: Workaround for EvalInfo ctor for MSVC 2017 
(authored by yaxunl).
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70729/new/

https://reviews.llvm.org/D70729

Files:
  clang/lib/AST/ExprConstant.cpp
  clang/test/Sema/eval-info.c


Index: clang/test/Sema/eval-info.c
===================================================================
--- /dev/null
+++ clang/test/Sema/eval-info.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -fsyntax-only -triple x86_64-unknown-windows-msvc -verify
+
+// expected-no-diagnostics
+
+// Make sure the new constant interpolator is not enabled unintentionally
+// to cause assertion.
+typedef enum x {
+  a = 1,
+} x;
Index: clang/lib/AST/ExprConstant.cpp
===================================================================
--- clang/lib/AST/ExprConstant.cpp
+++ clang/lib/AST/ExprConstant.cpp
@@ -921,10 +921,10 @@
     EvalInfo(const ASTContext &C, Expr::EvalStatus &S, EvaluationMode Mode)
         : Ctx(const_cast<ASTContext &>(C)), EvalStatus(S), 
CurrentCall(nullptr),
           CallStackDepth(0), NextCallIndex(1),
-          StepsLeft(getLangOpts().ConstexprStepLimit),
-          ForceNewConstInterp(getLangOpts().ForceNewConstInterp),
+          StepsLeft(C.getLangOpts().ConstexprStepLimit),
+          ForceNewConstInterp(C.getLangOpts().ForceNewConstInterp),
           EnableNewConstInterp(ForceNewConstInterp ||
-                               getLangOpts().EnableNewConstInterp),
+                               C.getLangOpts().EnableNewConstInterp),
           BottomFrame(*this, SourceLocation(), nullptr, nullptr, nullptr),
           EvaluatingDecl((const ValueDecl *)nullptr),
           EvaluatingDeclValue(nullptr), HasActiveDiagnostic(false),


Index: clang/test/Sema/eval-info.c
===================================================================
--- /dev/null
+++ clang/test/Sema/eval-info.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -fsyntax-only -triple x86_64-unknown-windows-msvc -verify
+
+// expected-no-diagnostics
+
+// Make sure the new constant interpolator is not enabled unintentionally
+// to cause assertion.
+typedef enum x {
+  a = 1,
+} x;
Index: clang/lib/AST/ExprConstant.cpp
===================================================================
--- clang/lib/AST/ExprConstant.cpp
+++ clang/lib/AST/ExprConstant.cpp
@@ -921,10 +921,10 @@
     EvalInfo(const ASTContext &C, Expr::EvalStatus &S, EvaluationMode Mode)
         : Ctx(const_cast<ASTContext &>(C)), EvalStatus(S), CurrentCall(nullptr),
           CallStackDepth(0), NextCallIndex(1),
-          StepsLeft(getLangOpts().ConstexprStepLimit),
-          ForceNewConstInterp(getLangOpts().ForceNewConstInterp),
+          StepsLeft(C.getLangOpts().ConstexprStepLimit),
+          ForceNewConstInterp(C.getLangOpts().ForceNewConstInterp),
           EnableNewConstInterp(ForceNewConstInterp ||
-                               getLangOpts().EnableNewConstInterp),
+                               C.getLangOpts().EnableNewConstInterp),
           BottomFrame(*this, SourceLocation(), nullptr, nullptr, nullptr),
           EvaluatingDecl((const ValueDecl *)nullptr),
           EvaluatingDeclValue(nullptr), HasActiveDiagnostic(false),
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to