forked from rust-lang/rust-bindgen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix template union forward declaration, close rust-lang#1768
- Loading branch information
1 parent
b2a9472
commit bf8a164
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
bindgen-tests/tests/expectations/tests/union_template_forward_decl.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
bindgen-tests/tests/headers/union_template_forward_decl.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// bindgen-flags: --with-derive-hash --with-derive-partialeq --with-derive-eq | ||
// | ||
template <typename value_t> | ||
union declare_union; // Primary template declared, but never defined. | ||
|
||
template <typename value_t> union declare_union<value_t *> { | ||
declare_union() {} | ||
declare_union(value_t *a_value) : value(a_value) {} | ||
value_t *value; | ||
}; | ||
|
||
template <typename value_t> union define_union { | ||
define_union() {} | ||
define_union(value_t *a_value) : value(a_value) {} | ||
value_t *value; | ||
int dummy; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters