rootcint problem

From: Clark McGrew <clark.mcgrew_at_sunysb.edu>
Date: Sat, 02 Jul 2005 12:49:50 -0400


Hello All,

I've run into a problem with ROOT 4.00.08 being used with GCC 3.3.6 in a corner case of the handling of templates. I'm sorry, but I haven't checked in later versions.

The problem seems to originate from how ROOTCINT handles sub-classes defined inside of a template. I've attached a short example.

In the example, the CINT dictionary was generated using:

rootcint -f THandle_Dict.cxx -c -p THandle.hxx THandle_LinkDef.h

The problematic line is in THandle_Dict.cxx:

static int G__THandle_Dict_143_2_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {

   G__letint(result7,85,(long)((const THandle<TObject>*)(G__getstructoffset()))->operator Tester*());    return(1 || funcname || hash || result7 || libp) ; }

I believe the correct code is:

static int G__THandle_Dict_143_2_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {

   G__letint(result7,85,(long)((const THandle<TObject>*)(G__getstructoffset()))->operator THandle<TObject>::Tester*());    return(1 || funcname || hash || result7 || libp) ; }

Thanks,
Clark

-- 
Clark McGrew                    Univ. at Stony Brook, Physics and Astronomy

<clark.mcgrew_at_stonybrook.edu> 631-632-8299

#ifndef THandle_hxx_seen #define THandle_hxx_seen #include <TObject.h> template <class T> class THandle { public: THandle() { } virtual ~THandle() {} private: class Tester { void operator delete(void*); public: void bogo() {} }; public: //********************** CAUSES THE BUG ************** operator Tester*() const { static Tester test; return &test; } ClassDefT(THandle,1); }; ClassDefT2(THandle,T); #endif

Received on Sat Jul 02 2005 - 18:50:17 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:10 MET