Re: "foo" + TString("bar") fails: can not call private or protected function TImage::TImage(char*)

From: Fons Rademakers <Fons.Rademakers_at_cern.ch>
Date: Mon, 10 Aug 2009 16:33:32 +0200


Interesting ;-) The TImage.h has:

friend TImage operator+(const TImage &i1, const TImage &s2);

and

protected:

    TImage(const char *file) : TNamed(file, "") { }

it seems that CINT is trying to convert "foo" to a TImage using TImage(const char*) to be able to do the + using

TImage operator+(const TImage &i1, const TImage &s2);

Clearly a problem for our CINT guys, Philippe and Axel.

Cheers, Fons.

Nick West wrote:
> Dear RootTalk,
>
> First, forgive this multiple posting, but I sent this last Friday and
> have not yet seen it posted to
> the list so I am sending this again.
>
> We in MINOS have come across a CINT parsing problem that can be
> demonstrated with the following lines:-
>
> #include "TImage.h"
> "foo" + TString("bar")
>
> which fails:-
>
> Error: can not call private or protected function (tmpfile):1:
>
> /data/minos/minos/software/OO/minos_packs_sl4/root_svn_1/root/lib/libGra
> f.so -1 TImage TImage::TImage(const char*);
> Calling : TImage::TImage(char*);
> Match rank: file line signature
> ffffffff
> /data/minos/minos/software/OO/minos_packs_sl4/root_svn_1/root/lib/libGra
> f.so -1 TImage TImage::TImage(UInt_t,UInt_t);
> ffffffff
> /data/minos/minos/software/OO/minos_packs_sl4/root_svn_1/root/lib/libGra
> f.so -1 TImage TImage::TImage(const TImage&);
> ffffffff
> /data/minos/minos/software/OO/minos_packs_sl4/root_svn_1/root/lib/libGra
> f.so -1 TImage TImage::TImage();
> * 1
> /data/minos/minos/software/OO/minos_packs_sl4/root_svn_1/root/lib/libGra
> f.so -1 TImage TImage::TImage(const char*);
> (class TString)143523640
> *** Interpreter error recovered ***
>
> This is with the current ROOT head, gcc version 3.4.6 Scientific Linux
> SL release 4.8.
>
> As recently as July 28 the code correctly produced:-
>
> (class TString)"foobar"
>
> and I think the problem commit must have occurred within a day as my
> build on the 29th failed, but for a variety of reasons I did not follow
> it up until the last few days.
>
> Cheers,
>
> Nick West
>

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers_at_cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640
Received on Mon Aug 10 2009 - 16:33:37 CEST

This archive was generated by hypermail 2.2.0 : Tue Aug 11 2009 - 11:50:02 CEST