TQClass::New fails for templates

I am working on event display for some project (FairRoot namely) and I want to modify a class FairBoxSet which derivates from TEveBoxSet to become a template (but I use it under name FairShapeSet), so from:

class FairShapeSet : public TEveBoxSet  { FairShapeSetDraw* fDraw{}; }

to

template<class T>
class FairShapeSet : public TEveBoxSet  { FairShapeSetDraw* fDraw{}; }
// pay attention that T is not used at all in the class body (it's MWE case)

There is another class FairShapeSetDraw which stories object (smart pointer) of FairShapeSet<int> and adds FreeBoxes into it. In the event display the boxes are then displayed. FairShapeSetDraw is abstract class (it has pure virtual method) and not used directly but is a base class for the final class, which displays boxes related to certain detector type.

When FairShapeBox is not a template, then everything works flawless, but when I change it to template, I have this error:

root [1] Error in <TQClass::New>: cannot create object of class FairShapeSet<int>
Warning in <TEveElement::PaintStandard >: IsA='FairShapeSet<int>'. Viewer3D requires more sections (48). Only direct-rendering supported.

In my code I replaced every use of FairShapeSet to FairShapeSet<int> and also in LinkDef there is appropriate change:

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class FairShapeSet<int>;

My first guess was that FairShapeSet needs to have default constructor, but not-templated class doesn’t have one and it works.

I’ve checked whether I can use the class manually:

root [0] auto cl = TQClass::GetClass("CbmMustHitSetDraw")
(TClass *) 0x55795b70dc70
root [1] cl->New()
(void *) 0x55795d88bd70
root [2] auto cl = TQClass::GetClass("FairShapeSetDraw")
(TClass *) 0x55795b1ff2c0
root [3] cl->New()
input_line_44:5:21: error: allocating an object of abstract class type 'FairShapeSetDraw'

which makes sense for FairShapeSetDraw as it is an abstract class. But it is nowhere used in the code directly beside being a base class (and also as said above, it works in the FairShapeSet is not a template). CbmMustHitSetDraw is created without problem.

So I don’t understand why and when, the macro tries to create the set-related class, and why it works for non-templated but fails for templated version.


ROOT Version: 6.36.00
Platform: Linux
Compiler: GCC-15