Skip to content

Commit f2d2266

Browse files
GKFXpvdrz
authored andcommitted
Fix regression spotted at #3027
1 parent d8dbe3e commit f2d2266

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

bindgen-tests/tests/expectations/tests/issue-3027.rs

+31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// bindgen-flags: --enable-cxx-namespaces
2+
3+
namespace regression {
4+
template<unsigned N> class A { char c[N]; };
5+
class C { A<3> a; };
6+
}

bindgen/codegen/helpers.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ pub(crate) fn blob(
102102
ty
103103
} else if ffi_safe && ctx.options().rust_features().min_const_generics {
104104
ctx.generated_opaque_array();
105-
syn::parse_quote! { __BindgenOpaqueArray<#ty, #data_len> }
105+
if ctx.options().enable_cxx_namespaces {
106+
syn::parse_quote! { root::__BindgenOpaqueArray<#ty, #data_len> }
107+
} else {
108+
syn::parse_quote! { __BindgenOpaqueArray<#ty, #data_len> }
109+
}
106110
} else {
107111
// This is not FFI safe as an argument; the struct above is
108112
// preferable.

0 commit comments

Comments
 (0)