From e9f2f45fe9bf79bd4aea47fa1ad9204b68510fd9 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Wed, 27 May 2009 03:37:57 +0000 Subject: Functions that return references can be rvalues as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72457 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprComplex.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/CodeGen/CGExprComplex.cpp') diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index 3e28490f6f..618e446bf1 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/lib/CodeGen/CGExprComplex.cpp @@ -255,6 +255,9 @@ VisitImaginaryLiteral(const ImaginaryLiteral *IL) { ComplexPairTy ComplexExprEmitter::VisitCallExpr(const CallExpr *E) { + if (E->getCallReturnType()->isReferenceType()) + return EmitLoadOfLValue(E); + return CGF.EmitCallExpr(E).getComplexVal(); } -- cgit v1.2.3