This commit is contained in:
Andreas Rumpf 2017-07-09 00:45:14 +02:00
commit b6307dded3

View file

@ -2126,6 +2126,13 @@ proc expr(p: BProc, n: PNode, d: var TLoc) =
if n.sons[0].kind != nkEmpty: if n.sons[0].kind != nkEmpty:
genLineDir(p, n) genLineDir(p, n)
var a: TLoc var a: TLoc
if n[0].kind in nkCallKinds:
# bug #6037: do not assign to a temp in C++ mode:
incl a.flags, lfSingleUse
genCall(p, n[0], a)
if lfSingleUse notin a.flags:
line(p, cpsStmts, a.r & ";" & tnl)
else:
initLocExpr(p, n.sons[0], a) initLocExpr(p, n.sons[0], a)
of nkAsmStmt: genAsmStmt(p, n) of nkAsmStmt: genAsmStmt(p, n)
of nkTryStmt: of nkTryStmt: