summaryrefslogtreecommitdiff
path: root/tests/headers/transform-op.hpp
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-10-28 19:34:05 -0400
committerGitHub <noreply@github.com>2018-10-28 19:34:05 -0400
commit5de943ca7bf6c155f7bae1d91f1e3b1d91e8d901 (patch)
tree6ef0452a22e9e0884fc50d8a03d7a49ad8839413 /tests/headers/transform-op.hpp
parenta242c51e6ff0d4cc27940a3927e713e8dff82c5f (diff)
parentb2083d5b4b070c4d5696c589245c291e40c7554f (diff)
Auto merge of #1430 - emilio:implicit-template-params, r=emiliov0.43.1
ir: Consistently append implicit template parameters when not using Rust unions. Fixes #1429.
Diffstat (limited to 'tests/headers/transform-op.hpp')
-rw-r--r--tests/headers/transform-op.hpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/tests/headers/transform-op.hpp b/tests/headers/transform-op.hpp
new file mode 100644
index 00000000..aa6118eb
--- /dev/null
+++ b/tests/headers/transform-op.hpp
@@ -0,0 +1,75 @@
+// bindgen-flags: --rust-target 1.0 -- -std=c++11
+
+typedef unsigned char uint8_t;
+typedef int int32_t;
+
+template<typename T>
+struct StylePoint {
+ T x;
+ T y;
+};
+
+template<typename T>
+union StyleFoo {
+ enum class Tag : uint8_t {
+ Foo,
+ Bar,
+ Baz,
+ Bazz,
+ };
+
+ struct Foo_Body {
+ Tag tag;
+ int32_t x;
+ StylePoint<T> y;
+ StylePoint<float> z;
+ };
+
+ struct Bar_Body {
+ Tag tag;
+ T _0;
+ };
+
+ struct Baz_Body {
+ Tag tag;
+ StylePoint<T> _0;
+ };
+
+ struct {
+ Tag tag;
+ };
+ Foo_Body foo;
+ Bar_Body bar;
+ Baz_Body baz;
+};
+
+template<typename T>
+struct StyleBar {
+ enum class Tag {
+ Bar1,
+ Bar2,
+ Bar3,
+ Bar4,
+ };
+
+ struct StyleBar1_Body {
+ int32_t x;
+ StylePoint<T> y;
+ StylePoint<float> z;
+ };
+
+ struct StyleBar2_Body {
+ T _0;
+ };
+
+ struct StyleBar3_Body {
+ StylePoint<T> _0;
+ };
+
+ Tag tag;
+ union {
+ StyleBar1_Body bar1;
+ StyleBar2_Body bar2;
+ StyleBar3_Body bar3;
+ };
+};