(root)CINT parsing problem

From: Rutger van der Eijk (r36@nikhef.nl)
Date: Tue Oct 19 1999 - 13:29:40 MEST


Hi,

Consider the following lines of code:

----------------
class SubClass;


class TopClass {
public:
  TopClass() { }
  ~TopClass() { }

  class SubClass {
  public:
    inline SubClass();
    ~SubClass() { }
  };

  inline SubClass getSubClass();
};


inline TopClass::SubClass::
SubClass() 
{
}


inline TopClass::SubClass TopClass::getSubClass() {
  return SubClass(); 
}
-----------------

Running rootcint on this produces the output:

Error: class,struct,union or type TopClass::SubClass not defined
FILE:./include/TopClass.H LINE:30
Error: class,struct,union or type TopClass::SubClassTopClass not defined
FILE:./include/TopClass.H LINE:36
Warning: Error occured during reading source files
Note: operator new() masked 1c
Note: operator delete() masked 1c
Warning: Error occured during dictionary source generation
Error loading headers...
gmake: *** [../dict/dictRootTest.C] Error 1


i.e. rootcint has problems parsing this and terminates. If you now remove
the forward declaration 

class SubClass;

in the beginning it runs without problems. This looks to me like some
parsing error of (root)CINT...

Ofcourse in the above example the forward declaration isn't necesarry but
in the real code (this is only a stripdown of that code to catch essence 
of problem) that gives me this problem it is. 

I'm not able to change the 'real code' to not give this problem because
it's not my code (it occurs in HepGenMatrix of CLHEP). I don't think it's
wrong C++ anyway so I think changes should be made on parser.

This problem results in a failure to generate shared libs for me only now
I'm moving to roor v2.23. With root v2.22 I also got these error messages
but rootcint didn't stop and I assumed I could ignore them (with seemed to
work uit fine). However with v2.23 rootcint stops which so I can not make
this 'dirty' assumption anymore => i.e. I can't work with v2.23! A
quick bug fix or (if not possible) a workaround for me would be very
usefull as I seem not to be able to move to v2.23 like this...

Thanks,

Rutger



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:41 MET