fixes #14514 [backport:1.2] (#14533)

(cherry picked from commit 8710395a0f)
This commit is contained in:
Andreas Rumpf
2020-06-01 12:33:13 +02:00
committed by narimiran
parent 56b1e52e17
commit 33bf7839ba

View File

@@ -43,7 +43,9 @@ proc preventNrvo(p: BProc; le, ri: PNode): bool =
for i in 1..<ri.len:
let r = ri[i]
if isPartOf(le, r) != arNo: return true
if canRaiseDisp(p, ri[0]) and
# we use the weaker 'canRaise' here in order to prevent too many
# annoying warnings, see #14514
if canRaise(ri[0]) and
(p.nestedTryStmts.len > 0 or locationEscapes(p, le)):
message(p.config, le.info, warnObservableStores, $le)