diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2017-06-19 14:01:46 -0700 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2017-06-20 15:35:27 -0700 |
commit | 979f5aae9a078a54aec18d4a6cfe38f34322f534 (patch) | |
tree | e1a7f6ef2a7df6a3835ec7870afe60cdded41a35 /tests/headers/template-with-var.hpp | |
parent | 26094eaec30a5b89aac61b541a9cd20a131f861d (diff) |
Ensure that every item is in some module's children list
Previously, if an item's parent was not a module (eg a nested class definition
whose parent it the outer class definition) and the parent was not whitelisted
but the item was transitively whitelisted, then we could generate uses of the
item without emitting any definition for it. This could happen because we were
relying on the outer type calling for code generation on its inner types, but
that relies on us doing code generation for the outer type, which won't happen
if the outer type is not whitelisted.
This commit avoids this gotcha by ensuring that all items end up in a module's
children list, and so will be code generated even if their parent is not
whitelisted.
Fixes #769
Diffstat (limited to 'tests/headers/template-with-var.hpp')
-rw-r--r-- | tests/headers/template-with-var.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/headers/template-with-var.hpp b/tests/headers/template-with-var.hpp new file mode 100644 index 00000000..88f60d21 --- /dev/null +++ b/tests/headers/template-with-var.hpp @@ -0,0 +1,7 @@ +template<typename T> +class TemplateWithVar { + // We shouldn't generate bindings for this because there are potentially + // many instantiations of this variable, but we can't know which ones exist + // or don't. + static T var = 0; +}; |