Skip to content

Commit b1080e1

Browse files
committed
[clang][Interp] Convert complex initializers to rvalues
We internalle handle these via pointers, but we need to return them as RValues in initializers.
1 parent 6ce5159 commit b1080e1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/AST/Interp/EvalEmitter.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ EvaluationResult EvalEmitter::interpretExpr(const Expr *E,
4747
EvaluationResult EvalEmitter::interpretDecl(const VarDecl *VD,
4848
bool CheckFullyInitialized) {
4949
this->CheckFullyInitialized = CheckFullyInitialized;
50+
this->ConvertResultToRValue =
51+
VD->getAnyInitializer() &&
52+
(VD->getAnyInitializer()->getType()->isAnyComplexType());
5053
EvalResult.setSource(VD);
5154

5255
if (!this->visitDecl(VD) && EvalResult.empty())

0 commit comments

Comments
 (0)