[clang] 2cb61a1 - [clang][Interp] Fix initializing PredefinedExprs

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 9 03:03:19 PST 2024


Author: Timm Bäder
Date: 2024-02-09T11:54:40+01:00
New Revision: 2cb61a1d117e2c20e3372bc23bf12b919feaaca2

URL: https://github.com/llvm/llvm-project/commit/2cb61a1d117e2c20e3372bc23bf12b919feaaca2
DIFF: https://github.com/llvm/llvm-project/commit/2cb61a1d117e2c20e3372bc23bf12b919feaaca2.diff

LOG: [clang][Interp] Fix initializing PredefinedExprs

Added: 
    

Modified: 
    clang/lib/AST/Interp/ByteCodeExprGen.cpp
    clang/test/Sema/ms_predefined_expr.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index 2539e756226a19..aaa8ac834cf9fe 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -1750,8 +1750,7 @@ bool ByteCodeExprGen<Emitter>::VisitPredefinedExpr(const PredefinedExpr *E) {
   if (DiscardResult)
     return true;
 
-  assert(!Initializing);
-  return this->visit(E->getFunctionName());
+  return this->delegate(E->getFunctionName());
 }
 
 template <class Emitter>

diff  --git a/clang/test/Sema/ms_predefined_expr.cpp b/clang/test/Sema/ms_predefined_expr.cpp
index 9f4eb2763430dd..b42a494beef98f 100644
--- a/clang/test/Sema/ms_predefined_expr.cpp
+++ b/clang/test/Sema/ms_predefined_expr.cpp
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 %s -fsyntax-only -Wmicrosoft -verify -fms-extensions
+// RUN: %clang_cc1 %s -fsyntax-only -Wmicrosoft -verify -fms-extensions -fexperimental-new-constant-interpreter
 
 using size_t = __SIZE_TYPE__;
 


        


More information about the cfe-commits mailing list