[clang] b1080e1 - [clang][Interp] Convert complex initializers to rvalues
Timm Bäder via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 21 04:09:59 PST 2024
Author: Timm Bäder
Date: 2024-02-21T13:09:20+01:00
New Revision: b1080e187e91576ac6d44087f072583e101f0f51
URL: https://github.com/llvm/llvm-project/commit/b1080e187e91576ac6d44087f072583e101f0f51
DIFF: https://github.com/llvm/llvm-project/commit/b1080e187e91576ac6d44087f072583e101f0f51.diff
LOG: [clang][Interp] Convert complex initializers to rvalues
We internalle handle these via pointers, but we need to return
them as RValues in initializers.
Added:
Modified:
clang/lib/AST/Interp/EvalEmitter.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/Interp/EvalEmitter.cpp b/clang/lib/AST/Interp/EvalEmitter.cpp
index d90cf1812bb774..9cae25f5c4d642 100644
--- a/clang/lib/AST/Interp/EvalEmitter.cpp
+++ b/clang/lib/AST/Interp/EvalEmitter.cpp
@@ -47,6 +47,9 @@ EvaluationResult EvalEmitter::interpretExpr(const Expr *E,
EvaluationResult EvalEmitter::interpretDecl(const VarDecl *VD,
bool CheckFullyInitialized) {
this->CheckFullyInitialized = CheckFullyInitialized;
+ this->ConvertResultToRValue =
+ VD->getAnyInitializer() &&
+ (VD->getAnyInitializer()->getType()->isAnyComplexType());
EvalResult.setSource(VD);
if (!this->visitDecl(VD) && EvalResult.empty())
More information about the cfe-commits
mailing list