diff options
author | cooldome <cdome@bk.ru> | 2018-03-02 11:14:41 +0000 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-03-02 12:14:41 +0100 |
commit | 4164ec4f8b6d9968e69381edd35d9cf6fe79dee1 (patch) | |
tree | 6a6d003c83bb1e9b2cb3fe17a690011b3be5431a /tests | |
parent | 5ee9e86c87d831d32441db658046fc989a197ac9 (diff) | |
download | Nim-4164ec4f8b6d9968e69381edd35d9cf6fe79dee1.tar.gz |
Fixes #6837 (#7271)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cpp/temitlist.nim | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/cpp/temitlist.nim b/tests/cpp/temitlist.nim index a7a8ebde4..e88bf45bd 100644 --- a/tests/cpp/temitlist.nim +++ b/tests/cpp/temitlist.nim @@ -1,6 +1,7 @@ discard """ targets: "cpp" - output: '''6.0''' + output: '''6.0 +0''' """ # bug #4730 @@ -20,3 +21,16 @@ proc main = echo v[0] main() + +#------------ + +#bug #6837 +type StdString {.importCpp: "std::string", header: "<string>", byref.} = object +proc initString(): StdString {.constructor, importCpp: "std::string(@)", header: "<string>".} +proc size(this: var StdString): csize {.importCpp: "size", header: "<string>".} + +proc f(): csize = + var myString: StdString = initString() + return myString.size() + +echo f() |