parent
f3756d2ccb
commit
f4a0400de2
5 changed files with 31 additions and 25 deletions
|
|
@ -203,7 +203,8 @@ proc genSingleVar(p: BProc, a: PNode) =
|
|||
registerGcRoot(p, v)
|
||||
else:
|
||||
let imm = isAssignedImmediately(a.sons[2])
|
||||
if imm and p.module.compileToCpp and p.splitDecls == 0:
|
||||
if imm and p.module.compileToCpp and p.splitDecls == 0 and
|
||||
not containsHiddenPointer(v.typ):
|
||||
# C++ really doesn't like things like 'Foo f; f = x' as that invokes a
|
||||
# parameterless constructor followed by an assignment operator. So we
|
||||
# generate better code here:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue