summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-06-01 12:33:13 +0200
committerGitHub <noreply@github.com>2020-06-01 12:33:13 +0200
commit8710395a0f7b57bab755ea826a82e3ceef85aa52 (patch)
tree0ed626d09b93a58dfed8efe39f18c4cc7d156455 /compiler
parent5d0cf883c15b6bd348ecfe7865cb85ca05e341de (diff)
downloadNim-8710395a0f7b57bab755ea826a82e3ceef85aa52.tar.gz
fixes #14514 [backport:1.2] (#14533)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgcalls.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim
index e19e96503..10f5ef638 100644
--- a/compiler/ccgcalls.nim
+++ b/compiler/ccgcalls.nim
@@ -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)