summary refs log tree commit diff stats
path: root/tests/cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fixes #23962 `resetLoc`doenst produce any cgen code in `importcpp` types ↵Juan M Gómez2024-08-182-0/+49
| | | | (#23964)
* Adds `SEQ_DECL_SIZE 1` back under `clang` and a test (#23942)Juan M Gómez2024-08-122-0/+11
|
* This test for issue 9739 never needed to depend upon hash order (#23791)c-blake2024-07-031-2/+1
| | | | | (for `string` or any other key type). Independence is nice to ever change orders. So, change it to just `len` & a `doAssert` like the other test in the same file.
* #Fixes #23657 C++ compilation fails with: 'T1_' was not declared in t… ↵Juan M Gómez2024-06-021-0/+54
| | | | | (#23666) …his scope
* Fix duplicated member declarations in structs for C++ backend (#23512)HexSegfaultCat2024-04-181-0/+27
| | | | | | | | | | | | | | | When forward declaration is used with pragmas `virtual` or `member`, the declaration in struct is added twice. It happens because of missing check for `sfWasForwarded` pragma. Current compiler generates the following C++ code: ```cpp struct tyObject_Foo__fFO9b6HU7kRnKB9aJA1RApKw { N_LIB_PRIVATE N_NOCONV(void, abc)(NI x_p1); N_LIB_PRIVATE N_NOCONV(virtual void, def)(NI y_p1); N_LIB_PRIVATE N_NOCONV(void, abc)(NI x_p1); N_LIB_PRIVATE N_NOCONV(virtual void, def)(NI y_p1); }; ```
* adds ccMember CC fixes #23434 (#23457)Juan M Gómez2024-03-291-0/+17
|
* [Cpp] Fixes an issue when mixing hooks and calls (#23428)Juan M Gómez2024-03-211-1/+14
|
* [C++] Allow `member` to define static funcs (#23387)Juan M Gómez2024-03-111-1/+12
|
* fixes #12703; nim cpp rejects valid code would lose const qualifier for ↵ringabout2024-03-051-0/+14
| | | | | | cstring to string via cstrToNimstr (#23371) fixes #12703 ref #19588
* closes #10219; adds a test case (#23370)ringabout2024-03-051-0/+20
| | | closes #10219
* fixes #23306 nim cpp -r invalid code generation regression with closure ↵Juan M Gómez2024-02-261-0/+12
| | | | iterators and try/catch-like constructions (#23317)
* C++: ptr fields now pulls the whole type if it's a member in nkDotExpr (#22855)Juan M Gómez2023-10-232-1/+18
|
* adds support for noDecl in constructor (#22811)Juan M Gómez2023-10-111-1/+10
| | | Notice the test wouldnt link before
* marking a field with noInit allows to skip constructor initialiser (#22802)Juan M Gómez2023-10-081-0/+30
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* C++ Adds support for default arg using object construction syntax. Fixes a ↵Juan M Gómez2023-09-281-2/+29
| | | | | | | | | | compiler crash (#22768) `Foo()` below makes the compiler crash. ```nim proc makeBoo(a:cint = 10, b:cstring = "hello", foo: Foo = Foo()): Boo {.importcpp, constructor.} ```
* `constructor` now uses `result` instead of `this` (#22724)Juan M Gómez2023-09-191-4/+4
|
* prevents declaring a constructor without importcpp fixes #22712 (#22715)Juan M Gómez2023-09-181-0/+15
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* implements RFC: [C++] Constructors as default initializers (#22694)Juan M Gómez2023-09-141-0/+33
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #22680 Nim zero clear an object inherits C++ imported class when a ↵Juan M Gómez2023-09-111-0/+50
| | | | proc return it (#22684)
* fixes #22669 constructor pragma doesnt init Nim default fields (#22670)Juan M Gómez2023-09-101-1/+34
| | | | | | | fixes #22669 constructor pragma doesnt init Nim default fields --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #22679 Nim zero clear an object contains C++ imported class when a ↵Juan M Gómez2023-09-101-0/+50
| | | | proc return it (#22681)
* fixes #22662 Procs with constructor pragma doesn't initialize object's ↵Juan M Gómez2023-09-081-1/+22
| | | | | | | | | | fields (#22665) fixes #22662 Procs with constructor pragma doesn't initialize object's fields --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* adds support for functor in member (#22433)Juan M Gómez2023-08-101-0/+11
| | | | | * adds support for functor in member * improves functor test
* makes asmnostackframe work with cpp member #22411 (#22429)Juan M Gómez2023-08-091-0/+37
|
* [C++] Member pragma RFC (https://github.com/nim-lang/RFCs/issues/530) (#22272)Juan M Gómez2023-08-071-0/+53
| | | | | | | | | | * [C++] Member pragma RFC #530 rebase devel * changes the test so `echo` is not used before Nim is init * rebase devel * fixes Error: use explicit initialization of X for clarity [Uninit]
* fixes an issue where byref wasnt properly handled when using it in a generic ↵Juan M Gómez2023-07-291-0/+27
| | | | | | | param (#22337) * fixes an issue where byref wasnt properly handled when using it in a generic param * removes unreachable check
* Expands codegenDecl to work in function params. fixes #22306 (#22307)Juan M Gómez2023-07-231-0/+17
| | | | | | | * Expands codegenDecl to work in function params. fixes #22306 * makes the test more concrete so T{lit} params dont match * adds sfCodegenDecl
* Fixes Naive virtual crash the compiler fixes #22269 (#22271)Juan M Gómez2023-07-161-0/+4
| | | | | * Fixes Naive virtual crash the compiler fixes #22269 * adds type specific test
* Implements: [C++] constructor pragma improvement (fix #21921) (#21916)Juan M Gómez2023-05-301-2/+33
| | | | | | | | | | | | | | | * implements: [C++] constructor pragma improvement (fix #21921) t * fix test so it doesnt use echo in globals * Update compiler/ccgtypes.nim * Update lib/std/private/dragonbox.nim --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* actually fixes #21889 "constructor pragma doing nothing in globals" (#21897)Juan M Gómez2023-05-241-0/+24
| | | actually fixes #21889
* implements allow byref to work in params #21873 (#21875)Juan M Gómez2023-05-211-5/+14
|
* Cpp Vfunctions draft (#21790)Juan M Gómez2023-05-171-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * introduces virtual pragma, modifies proc def, prevents proc decl * marks virtual procs as infix * forward declare vfuncs inside the typedef * adds naked callConv to virtual * virtual proc error if not defined in the same top level scope as the type * first param is now this. extracts genvirtualheaderproc * WIP syntax * supports obj. Removes the need for the prefix * parameter count starts as this. Cleanup * clean up * sem tests * adds integration tests * uses constraint to store the virtual content * introduces genVirtualProcParams --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Revert "Fix #13093 C++ Atomics: operator= is implicitly deleted because the ↵ringabout2023-01-272-44/+0
| | | | | | | default definition would be ill-formed " (#21307) Revert "Fix #13093 C++ Atomics: operator= is implicitly deleted because the default definition would be ill-formed (#21169)" This reverts commit a7bae919adb952362cb53206140872d2b7424b47.
* Fix #13093 C++ Atomics: operator= is implicitly deleted because the default ↵Bung2023-01-272-0/+44
| | | | | | | | | | | | | definition would be ill-formed (#21169) * add test * fix #17982 Invalid C++ code generation when returning discardable var T * fix #13093 * cpp atomic good example * clearify the condition
* add the cpp target (#21164)ringabout2022-12-231-0/+4
| | | The issue is related to cpp codegen, the previous test doesn't test cpp backend, which will join into the megatest.
* fix #12946 Bad C++ codegen on distinct generics C++ types (#21157)Bung2022-12-231-0/+4
|
* ship a modern nimble with lock files support (#21061)ringabout2022-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * change `include genode/env` to an import ref https://github.com/nim-lang/Nim/commit/0b262e9496387d5e8adc0c5f6020b3f3300e8f79#diff-8718bd20d8f61d6638d3d64b19efc31bcd40a6d5be8215b2a1f0b75ed93e8d56 * fixes comments * ship a modern nimble with lock files support * not sure whether the latest nimble has a regression now I'm trying 0.14.0 * change `pkgs` to `pkgs2` (#21073) * overwrite problematic packages * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review
* closes #4678; add testcase (#20634)ringabout2022-10-241-0/+16
|
* moderate system cleanup & refactor (#20355)metagn2022-09-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * system refactor, move out 600 lines * compilation, slice, backwardsindex, misc_num moved out of system * some procs/types moved into arithmetics, basic_types * system no longer depends on syncio * some procs moved around to fit with their surroundings * make exceptions an import, old ops to misc_num * move instantiationInfo back * move back nim version, fix windows echo * include compilation * better docs for imported modules, fix unsigned ops also remove ze, ze64, toU8, toU16, toU32 with nimPreviewSlimSystem * fix terminal * workaround IC test & weird csize bug, changelog * move NimMajor etc back to compilation, rebase for CI * try ic fix * form single `indices`, slim out TaintedString, try fix IC * fix CI, update changelog, addQuitProc * fix CI * try fix CI * actually fix CI finally hopefully * Update lib/system/compilation.nim Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> * update kochdocs * hopefully fix csize uses for slimsystem * fix tquit Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* fix #17351; switch to c++17 and remove hacks (#20407)ringabout2022-09-231-1/+11
| | | | | * fix #17351; switch to c++17 * remove workaround
* remove deprecated type pragma syntax, fix bugs that required it (#20199)metagn2022-09-033-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | * remove deprecated pragma syntax from 0.20.0 closes #4651, closes #16653 with a cheap fix for now due to how early `tfFinal` is set * remove type pragma between name and generics * undo removal, try removing bind expression (0.8.14) * fix test, unremove bind expr * remove again * Update changelog.md Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * dependencies @ HEAD & weave test dependencies * try fix package ci Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* move io out of system (#19442)flywind2022-02-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * move io out of system * fix tests * fix tests * next step * rename to syncio * rename * fix nimscript * comma * fix * fix parts of errors * good for now * fix test
* style usages part one (openarray => openArray) (#19321)flywind2022-01-041-4/+4
| | | | | * style usages (openArray) * revert doc changes
* fix #18410 (Errors initializing an object of RootObj with the C++ backend) ↵flywind2021-10-311-0/+15
| | | | | | | | | | | | | [backport] (#18836) * fix #18410 * one line comment * typo * typo * cover cpp
* refs #18011 disable some newly failing tests on cpp windows; refs #17946 ↵Timothee Cour2021-05-142-2/+6
| | | | increase timeout for tchannels (#18012)
* system.nim cleanup some exported constants which should never have be… ↵Andreas Rumpf2021-05-011-1/+1
| | | | | | (#17909) * system.nim cleanup some exported constants which should never have been exported
* `--nilseqs` is now a deprecated noop (#17211)Timothee Cour2021-03-011-1/+1
| | | | | * --nilseqs is now a deprecated noop * fix tests; fix: future => sugar
* remove tests/deps/ (#17132)Timothee Cour2021-02-231-1/+1
| | | | | | | | | * remove tests/deps/ * fix tests * fix tests/manyloc/keineschweine/lib/zlib_helpers.nim * fixup
* close #4834 add testcase (#16649)flywind2021-01-091-0/+17
|
* improve examples in manual (#16497)flywind2020-12-291-1/+1
| | | | | | | | | | | | | * improve examples in manual * Update doc/manual.rst Co-authored-by: Clyybber <darkmine956@gmail.com> * Update tests/cpp/ttemplatetype.nim Co-authored-by: Clyybber <darkmine956@gmail.com> Co-authored-by: Clyybber <darkmine956@gmail.com>