diff options
-rw-r--r-- | src/gen.rs | 2 | ||||
-rw-r--r-- | tests/headers/template.hpp | 5 |
2 files changed, 6 insertions, 1 deletions
@@ -1239,7 +1239,7 @@ fn cstruct_to_rs(ctx: &mut GenCtx, name: &str, ci: CompInfo) -> Vec<P<ast::Item> items.push(mk_impl(ctx, id_ty, unmangledlist)); } - if !ci.vars.is_empty() { + if !ci.vars.is_empty() && template_args.is_empty() { let vars = ci.vars.into_iter().map(|v| { let vi = v.varinfo(); let v = vi.borrow_mut(); diff --git a/tests/headers/template.hpp b/tests/headers/template.hpp index 29a0792b..c13643c3 100644 --- a/tests/headers/template.hpp +++ b/tests/headers/template.hpp @@ -137,3 +137,8 @@ class ReplacedWithDestructorDeclaredAfter { T* buff; ~ReplacedWithDestructorDeclaredAfter() {}; }; + +template<typename T> +class TemplateWithVar { + static T var = 0; +}; |