You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When declaring a static function inside a templated type, concrete type generation lack the static function, maybe I am doing something wrong here, is this normal behavior?
use autocxx::prelude::*;include_cpp!{
#include "test.h"
safety!(unsafe_ffi)
concrete!("Toto<int>",TotoInt)}fnmain(){
ffi::TotoInt::test();}
build.rs
fnmain() -> miette::Result<()>{letmut b = autocxx_build::Builder::new("src/main.rs",&["src"]).build()?;
b.cpp(true).std("c++20").compile("autocxx-demo");println!("cargo:rerun-if-changed=src/main.rs");Ok(())}
Cargo.toml
[package]
name = "test"version = "0.1.0"edition = "2021"
[dependencies]
cxx = "1.0"autocxx = "0.27.0"
[build-dependencies]
autocxx-build = "0.27.0"miette = { version = "5", features = ["fancy"] }
Expected behavior
Generate the corresponding call to the static function.
Additional context
Error message generated:
error[E0599]: no function or associated item named `test` found for struct `TotoInt` in the current scope
--> src/main.rs:10:19
|
10 | ffi::TotoInt::test();
| ^^^^ function or associated item not found in `TotoInt`
|
::: /autocxx-ffi-default-gen.rs:1:1143
|
1 | ...& str) -> UniquePtr < CxxString > ; type TotoInt ; include ! ("test.h") ; include ! ("autocxxgen_ffi.h") ; } extern "Rust" { } } # [allow (unused...
| ------------ function or associated item `test` not found for this struct
The text was updated successfully, but these errors were encountered:
Thanks for the report. If you'd like me to look at this any time soon, please raise a pull request with a failing test in integration_tests.rs. I'm not actually sure whether I'd expect this to work, nor how hard it would be to get it to work.
Describe the bug
When declaring a static function inside a templated type, concrete type generation lack the static function, maybe I am doing something wrong here, is this normal behavior?
To Reproduce
src/test.h
src/main.rs
build.rs
Cargo.toml
Expected behavior
Generate the corresponding call to the static function.
Additional context
Error message generated:
The text was updated successfully, but these errors were encountered: