summary refs log tree commit diff stats
path: root/tests/cpp/t22712.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cpp/t22712.nim')
-rw-r--r--tests/cpp/t22712.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/cpp/t22712.nim b/tests/cpp/t22712.nim
new file mode 100644
index 000000000..34ef67ac8
--- /dev/null
+++ b/tests/cpp/t22712.nim
@@ -0,0 +1,15 @@
+discard """
+targets: "cpp"
+errormsg: "constructor in an imported type needs importcpp pragma"
+line: 14
+"""
+{.emit: """/*TYPESECTION*/
+struct CppStruct {
+  CppStruct();
+};
+""".}
+
+type CppStruct {.importcpp.} = object
+
+proc makeCppStruct(): CppStruct {.constructor.} = 
+  discard
\ No newline at end of file