http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54437

--- Comment #1 from Markus Trippelsdorf <markus at trippelsdorf dot de> 
2012-08-31 13:07:54 UTC ---
This is what Creduce came up with:

typedef bool (*IsAcceptableThis)(const int& v);
typedef bool (*NativeImpl)(int *, int);
template<IsAcceptableThis, NativeImpl>void CallNonGenericMethod();
typedef int (*JSNative)(int *, unsigned, int *);
struct A
{};
class B : A {
  static bool                  is(const int& p1);
  template<int(B&)>static bool getterImpl(int *,
                                          int);
  template<int(B&)>static int  getter(int *,
                                      unsigned,
                                      int *);
  template<int(B&)>static bool defineGetter();
  static int                   byteOffsetValue(B&);
  A                          * initClass();
};
A *js_NewFunction(JSNative);
template<int
         ValueGetter(B&)>int
         B::getter(int *, unsigned, int *)
{
  CallNonGenericMethod<is, getterImpl<ValueGetter> >();
}

template<int
         ValueGetter(B&)>
bool
         B::defineGetter()
{
  A *a = js_NewFunction(B::getter<ValueGetter>);
}

A *
B::initClass()
{
  defineGetter<byteOffsetValue>;
}

Reply via email to