summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
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