Re: error with rootcint

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Thu, 23 Feb 2006 21:35:16 +0100


Hi Christian,
the error Piergiorgio refers to is in rootcint generated code. The shadow classes don't know about throw() yet. Axel.

Christian Holm Christensen wrote:
> On Thu, 2006-02-23 at 12:25 +0100, Axel Naumann wrote:

>> Hi,
>>
>> this is a known limitation that we'll make vanish soon. Until then, use
>> ClassDef(RangeError,0), or hide RangeError from rootcint:
>>
>> #ifdef __MAKECINT__
>> class RangeError;
>> #else
>> class RangeError: public std::exception {
>> // the real class definition
>> ... };
>> #endif

>
> What about defining the destructor himself?
>
> > cat foo.hh
> #include <stdexcept>
> #include <cerrno>
>
> struct foo : public std::exception
> {
> std::string _msg;
> foo(int eno) : _msg(strerror(eno)) {}
> // Un-comment to succeed
> // virtual ~foo() throw () {}
> const char* what() const throw() { return _msg.c_str(); }
> };
> > rootcint -f foodict.cc -c foo.hh
> > g++ foodict.cc -c `root-config --cflags`
> foo.hh:5: error: looser throw specifier for 'virtual
> foo::~foo()'
>
> Un-commenting the line marked above, solves the problem.
>
> Yours,
>
Received on Thu Feb 23 2006 - 21:35:24 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:57 MET