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

cannot bind rvalue reference of type .. to lvalue of type .. / pointer argument requires that the function be marked unsafe #1348

Open
lnicola opened this issue Dec 7, 2023 · 1 comment
Labels
bug Something isn't working need-test-case Needs a test case

Comments

@lnicola
Copy link

lnicola commented Dec 7, 2023

Describe the bug
I'm getting the error in the issue.

To Reproduce

use autocxx::prelude::*;
use autocxx::subclass::*;

include_cpp! {
    #include "gdal/gdal_priv.h"
    safety!(unsafe_ffi)
    generate!("GDALDataset")
    subclass!("GDALDataset", MyDataset)
}

use ffi::*;

#[subclass]
#[derive(Default)]
pub struct MyDataset;

impl GDALDataset_methods for MyDataset {}

fn main() {}

Expected behavior
I'd like it to work.

Additional context
Requires gdal-devel or similar.

EDIT: dropping safety!(unsafe_ffi) fixes this, but then it fails with error: cannot bind rvalue reference of type ‘std::unique_ptr<GDALRelationship>&&’ to lvalue of type ‘std::unique_ptr<GDALRelationship>’.

@lnicola lnicola changed the title pointer argument requires that the function be marked unsafe cannot bind rvalue reference of type .. to lvalue of type .. / pointer argument requires that the function be marked unsafe Dec 9, 2023
@adetaylor adetaylor added bug Something isn't working need-test-case Needs a test case labels Mar 5, 2025
@adetaylor
Copy link
Collaborator

Please raise a bug PR per https://google.github.io/autocxx/reporting_bugs.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need-test-case Needs a test case
Projects
None yet
Development

No branches or pull requests

2 participants