Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options to generate uncallable C++ functions. #3139

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

adetaylor
Copy link
Contributor

Downstream code generators may need to know about the existence of certain C++ functions even if those functions can't be called. This is counterintuitive but:

  • A type can't even be allocated if it contains pure virtual functions or if its constructor is private.
  • A type may not be relocatable if it contains a deleted move constructor.

This PR provides command line options to reveal the existence of these functions. Subsequent PRs will announce their special status using the ParseCallbacks mechanism.

Part of google/autocxx#124.

Downstream code generators may need to know about the existence of certain C++
functions even if those functions can't be called. This is counterintuitive but:

* A type can't even be allocated if it contains pure virtual functions
  or if its constructor is private.
* A type may not be relocatable if it contains a deleted move constructor.

This PR provides command line options to reveal the existence of these
functions. Subsequent PRs will announce their special status using the
ParseCallbacks mechanism.

Part of google/autocxx#124.
@adetaylor adetaylor mentioned this pull request Feb 19, 2025
8 tasks
@emilio
Copy link
Contributor

emilio commented Feb 19, 2025

Clippy seems unhappy and so on, but this seems fine.

@adetaylor adetaylor marked this pull request as ready for review February 19, 2025 16:01
adetaylor added a commit to adetaylor/rust-bindgen that referenced this pull request Feb 21, 2025
This change reports extra C++ information about items:

* Whether methods are virtual or pure virtual or neither
* Whether a method is a "special member", e.g. a move constructor
* Whether a method is defaulted or deleted
* C++ visibility (for structs, enums, unions and methods)

It builds on top of rust-lang#3145.

This PR is not yet ready for merge, since we need to merge rust-lang#3139
and then enhance the tests to cover those cases too.

Part of google/autocxx#124
adetaylor added a commit to adetaylor/rust-bindgen that referenced this pull request Feb 21, 2025
This change reports extra C++ information about items:

* Whether methods are virtual or pure virtual or neither
* Whether a method is a "special member", e.g. a move constructor
* Whether a method is defaulted or deleted
* C++ visibility (for structs, enums, unions and methods)

It builds on top of rust-lang#3145.

A follow up PR should enhance the tests once rust-lang#3139 is merged.

Part of google/autocxx#124
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.

2 participants