Skip to content

Handle inherited constructors#23

Open
slburson wants to merge 6 commits into
borodust:masterfrom
slburson:inherited-constructors-pr
Open

Handle inherited constructors#23
slburson wants to merge 6 commits into
borodust:masterfrom
slburson:inherited-constructors-pr

Conversation

@slburson

@slburson slburson commented Jun 18, 2026

Copy link
Copy Markdown

This PR depends on #20, and should not be merged until that one is. It also depends on PRs with the same title for libresect and cl-resect.

C++'s constructor-inheritance feature is just hell to deal with. Libclang is not as much help as it should be, because inherited constructors do not appear on the subclass's CXType unless they're referenced. (I tried declaring an instance of the subclass, as is done for templates in prepared_header.h, but that didn't cause the constructors to show up.) It is possible to find all the inherited constructors by walking the decl, however, and I figured out how to do this.

This allows me to revert the changes I had made to the LibTorch headers that edited out all uses of constructor inheritance.

The generated adapter compiles and loads, and I have spot-checked the differences between the previous results (with constructor inheritance hand-edited out) and the new ones, and they look reasonable.

I ran into a couple more minor bugs in claw.util:split-template-name-into-groups and claw.util:join-groups-into-template-name; I made minor changes to the former and rewrote the latter. I added a few tests in test/util/util.lisp; look there to see what was wrong.

Scott L. Burson added 4 commits June 18, 2026 02:49
Squashed commit of the following:

commit 80fff37
Author: Scott L. Burson <gyro@reasoning.ai>
Date:   Thu Jun 18 01:35:48 2026 -0700

    Fix various bugs

    Seems to be working!

commit 181c9b5
Author: Scott L. Burson <gyro@reasoning.ai>
Date:   Mon Jun 15 21:05:55 2026 -0700

    Almost working, but still some bugs

commit fd886c5
Merge: 4dcff07 4647655
Author: Scott L. Burson <gyro@reasoning.ai>
Date:   Sat Jun 13 14:22:27 2026 -0700

    Merge branch 'master' into inherited-constructors

commit 4dcff07
Author: Scott L. Burson <gyro@reasoning.ai>
Date:   Mon Jun 8 21:07:52 2026 -0700

    WIP
Scott L. Burson added 2 commits June 21, 2026 15:29
I saw that there were more occurrences of "__claw_this_", so instead
of converting them all, I just took out the named constant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant