summary refs log tree commit diff stats
path: root/tests/cpp/t22712.nim
blob: 34ef67ac85e515f092a123a0c630e4040e17c693 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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