summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gen.rs2
-rw-r--r--tests/headers/template.hpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/gen.rs b/src/gen.rs
index 2c8b0bd2..1aac407e 100644
--- a/src/gen.rs
+++ b/src/gen.rs
@@ -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;
+};