summary refs log tree commit diff stats
path: root/tests/cpp
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2021-01-09 04:54:26 -0600
committerGitHub <noreply@github.com>2021-01-09 11:54:26 +0100
commitdbff2cd938b326279de0f3f97b2dd8c54a90468a (patch)
tree28701f673ad104d158336a0336372bb3802ca22d /tests/cpp
parentb7ff0b2a1128dc976379102e180ae883641d6c82 (diff)
downloadNim-dbff2cd938b326279de0f3f97b2dd8c54a90468a.tar.gz
close #4834 add testcase (#16649)
Diffstat (limited to 'tests/cpp')
-rw-r--r--tests/cpp/t4834.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/cpp/t4834.nim b/tests/cpp/t4834.nim
new file mode 100644
index 000000000..0275b1b70
--- /dev/null
+++ b/tests/cpp/t4834.nim
@@ -0,0 +1,17 @@
+discard """
+  targets: "cpp"
+"""
+
+# issue #4834
+block:
+  defer:
+    let x = 0
+
+
+proc main() =
+  block:
+    defer:
+      raise newException(Exception, "foo")
+
+doAssertRaises(Exception):
+  main()