This commit is contained in:
cooldome 2019-04-03 09:42:41 +01:00 • committed by Andreas Rumpf
commit 734da9544d
2 changed files with 40 additions and 1 deletions

View file

@ -540,7 +540,7 @@ proc initLocExprSingleUse(p: BProc, e: PNode, result: var TLoc) =
discard "bug #8202; enforce evaluation order for nested calls for C++ too"
# We may need to consider that 'f(g())' cannot be rewritten to 'tmp = g(); f(tmp)'
# if 'tmp' lacks a move/assignment operator.
if e[0].kind == nkSym and sfConstructor in e[0].sym.flags:
if e[0].kind == nkSym and sfCompileToCpp in e[0].sym.flags:
result.flags.incl lfSingleUse
else:
result.flags.incl lfSingleUse