Home | News | Documentation | Download

Problem with the default constructor of TDatime in ROOT 6

Hello, could you add a default constructor to the TDatime class in order to avoid a crash when I type

I usually do that to have quickly access to the different methods of the class.

You defined a pointer “t” which by default is initialized with “NULL” in CINT (I think you should not count on it in compiled code).
Try: TDatime *t = new TDatime();

I fully agree with you that this does not be used in a compiled code. I use it in the interpreter. It is quite surprising because as I said, I use this way to have access quickly to the methods of a class. For exampe, if I type

TH1F *h h-> (+Tab)
all the methods are proposed. Yet, it is not the case with TDatime since the interpreter crashes directly after

This is ROOT v5-34-25: [code]root [0] TDatime::(+TAB)

~TDatime
TDatime
(…)
ImplFileName
DeclFileLine
root [0] TDatime::
root [0] TDatime *t
root [1] t->(+TAB)

~TDatime
TDatime
(…)
ImplFileName
DeclFileLine
root [1] t->[/code]

Indeed, the problem appears only in ROOT 6.02/05. It works fine in ROOT 5.34/25. I renamed the post to take into account this information.

Hi,

That looks like a bug to me (that has nothing to do with default constructors…) - I have created sft.its.cern.ch/jira/browse/ROOT-7095 for it. Let’s follow up over there.

Thanks for your report!

Axel.