Skip to content

Commit

Permalink
Fix regression spotted at #3027
Browse files Browse the repository at this point in the history
  • Loading branch information
GKFX authored and pvdrz committed Dec 2, 2024
1 parent d8dbe3e commit f2d2266
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
31 changes: 31 additions & 0 deletions bindgen-tests/tests/expectations/tests/issue-3027.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions bindgen-tests/tests/headers/issue-3027.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// bindgen-flags: --enable-cxx-namespaces

namespace regression {
template<unsigned N> class A { char c[N]; };
class C { A<3> a; };
}
6 changes: 5 additions & 1 deletion bindgen/codegen/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ pub(crate) fn blob(
ty
} else if ffi_safe && ctx.options().rust_features().min_const_generics {
ctx.generated_opaque_array();
syn::parse_quote! { __BindgenOpaqueArray<#ty, #data_len> }
if ctx.options().enable_cxx_namespaces {
syn::parse_quote! { root::__BindgenOpaqueArray<#ty, #data_len> }
} else {
syn::parse_quote! { __BindgenOpaqueArray<#ty, #data_len> }
}
} else {
// This is not FFI safe as an argument; the struct above is
// preferable.
Expand Down

0 comments on commit f2d2266

Please sign in to comment.