summaryrefslogtreecommitdiff
path: root/bindgen-tests/tests/headers/partial-specialization-and-inheritance.hpp
diff options
context:
space:
mode:
authorChristian Poveda <christian.poveda@ferrous-systems.com>2022-09-23 21:36:14 -0500
committerChristian Poveda <christian.poveda@ferrous-systems.com>2022-10-04 20:47:17 -0500
commit0296f9e86c7756e718b6b82836ce1e09b5f8d08a (patch)
treeb5954c6680b243c0b1671a80ea973ef90877e462 /bindgen-tests/tests/headers/partial-specialization-and-inheritance.hpp
parenta900f8f863d1313ad76603234aaeea22bb9ba7b3 (diff)
split the repo into a workspace
remove `clap` dependency :tada: update the book installation instructions
Diffstat (limited to 'bindgen-tests/tests/headers/partial-specialization-and-inheritance.hpp')
-rw-r--r--bindgen-tests/tests/headers/partial-specialization-and-inheritance.hpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/bindgen-tests/tests/headers/partial-specialization-and-inheritance.hpp b/bindgen-tests/tests/headers/partial-specialization-and-inheritance.hpp
new file mode 100644
index 00000000..4eb8f545
--- /dev/null
+++ b/bindgen-tests/tests/headers/partial-specialization-and-inheritance.hpp
@@ -0,0 +1,40 @@
+// bindgen-unstable
+
+// This was originally a test case generated by creducing errors in SpiderMonkey
+// bindings generation. I've tried to make it understandable by giving more
+// meaningful names to everything, and a couple comments.
+//
+// We don't support partial template specialization, but we *should*
+// successfully parse this header, and generate bindings for it, but the usage
+// of the partial template specialization should result in opaque blobs.
+
+// A base class providing a method.
+template <typename T>
+class Base {
+public:
+ void some_method(T, T);
+};
+
+// A template with a default representation.
+template <typename U>
+class Derived {
+ bool b;
+};
+
+// A partial specialization for pointers. Note that this should have a different
+// and larger layout than the template it is specializing.
+template <typename U>
+class Derived<U*> : public Base<U*> {
+ int x;
+ int y;
+};
+
+// A struct that uses the partial specialization and method from the partial
+// specialization's base class.
+struct Usage {
+ Usage() {
+ static_member.some_method(this, this);
+ }
+
+ static Derived<Usage*> static_member;
+};