1 // bindgen-unstable
2 
3 // This was originally a test case generated by creducing errors in SpiderMonkey
4 // bindings generation. I've tried to make it understandable by giving more
5 // meaningful names to everything, and a couple comments.
6 //
7 // We don't support partial template specialization, but we *should*
8 // successfully parse this header, and generate bindings for it, but the usage
9 // of the partial template specialization should result in opaque blobs.
10 
11 // A base class providing a method.
12 template <typename T>
13 class Base {
14 public:
15   void some_method(T, T);
16 };
17 
18 // A template with a default representation.
19 template <typename U>
20 class Derived {
21     bool b;
22 };
23 
24 // A partial specialization for pointers. Note that this should have a different
25 // and larger layout than the template it is specializing.
26 template <typename U>
27 class Derived<U*> : public Base<U*> {
28     int x;
29     int y;
30 };
31 
32 // A struct that uses the partial specialization and method from the partial
33 // specialization's base class.
34 struct Usage {
UsageUsage35   Usage() {
36       static_member.some_method(this, this);
37   }
38 
39   static Derived<Usage*> static_member;
40 };
41