summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorJuan M Gómez <info@jmgomez.me>2023-10-11 07:28:00 +0100
committerGitHub <noreply@github.com>2023-10-11 08:28:00 +0200
commitbf72d87f249221ed6623321f3cca0de9b35e0e36 (patch)
tree45c024dd183eb706e47dfb34ca8b120cca90b215 /tests
parent81b2ae747e307f4ab171d3b62a0e6ea8b6a81d3d (diff)
downloadNim-bf72d87f249221ed6623321f3cca0de9b35e0e36.tar.gz
adds support for noDecl in constructor (#22811)
Notice the test wouldnt link before
Diffstat (limited to 'tests')
-rw-r--r--tests/cpp/tconstructor.nim11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/cpp/tconstructor.nim b/tests/cpp/tconstructor.nim
index 8c5d4dca2..ac73b78e6 100644
--- a/tests/cpp/tconstructor.nim
+++ b/tests/cpp/tconstructor.nim
@@ -16,6 +16,7 @@ ___
 777
 10
 123
+()
 '''
 """
 
@@ -106,4 +107,12 @@ proc init =
     n.x = 123
     echo n.x
 
-init()
\ No newline at end of file
+init()
+
+#tests that the ctor is not declared with nodecl. 
+#nodelc also prevents the creation of a default one when another is created.
+type Foo {.exportc.} = object
+
+proc makeFoo(): Foo {.used, constructor, nodecl.} = discard
+
+echo $Foo()
\ No newline at end of file