hsutter / cppfront

A personal experimental C++ Syntax 2 -> Syntax 1 compiler
Other
5.23k stars 224 forks source link

Default-define out-of-line dtors for types with fwd-declared unique_ptr members #1088

Closed jarzec closed 1 week ago

jarzec commented 1 month ago

Some of the node types in parse.h have std::unique_ptr of forward-declared types as members without having destructors deferred to when the pointed-to types are defined. If the default deleter is used this is IFNDR. Despite that, all compilers seem to have been compiling such code without problem. Only recently Clang >=15 with C++23 enabled started to raise errors in such situations. This is likely due to the added constexpr in the default deleter, which seemed to have change changed implementation decisions.

This PR adds out-of-line defaulted destructors for such cases to fix the possible compiler errors. It also enables a build test for Clang 18 with C++23 to ensure the solution works.

jarzec commented 1 month ago

@hsutter The PR with the discussed updates is ready. For some reason, when I created it GitHub runners had a bad time and some testes were cancelled/skipped. The changes are OK as you can see from the tests of the same commit in my own fork. You can also rerun the failed steps ones manually for the PR in the Actions section.

jarzec commented 2 weeks ago

@hsutter I have rebased this branch on your current main to get all the CI tests to pass.

hsutter commented 1 week ago

Thanks!