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

generate_pod(type) not working on std::is_pod(type) #1381

Open
MidasLamb opened this issue Jul 17, 2024 · 1 comment
Open

generate_pod(type) not working on std::is_pod(type) #1381

MidasLamb opened this issue Jul 17, 2024 · 1 comment

Comments

@MidasLamb
Copy link

Describe the bug
I have a C++ type that is a pod (with static_assert(!std::is_pod) it fails, notice the !)

cargo:warning=src/bindings/osr/client_osr.cc:375:15: error: static assertion failed
cargo:warning=  375 | static_assert(!std::is_pod<cef_rect_t>());

so that means that cef_rect_t is a pod (according to the c++ function), but calling generate_pod("cef_rect_t") fails with

called `Result::unwrap()` on an `Err` value: ParseError(AutocxxCodegenError(Conversion(Cpp(UnsafePodType("Type cef_rect_t is a typedef to a complex type")))))

cef_rect_t is defined as follows:

typedef struct _cef_rect_t {
  int x;
  int y;
  int width;
  int height;
} cef_rect_t;

If I specify generate_pod("_cef_rect_t") (notice the leading underscore), then the generated cef_rect_t will also be marked as Trivial, but I still cannot specify generate_pod("cef_rect_t"), only generate("cef_rect_t"). The problem is mainly that other structs that contain a cef_rect_t that cannot be marked as a POD because of this.

Expected behavior
When static_assert(std::is_pod<cef_rect_t>()) passes, I should be able to use generate_pod("cef_rect_t")

@adetaylor
Copy link
Collaborator

Please raise a PR test case

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

No branches or pull requests

2 participants