DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5570>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5570

DOM_Range lacks the copy constructor

           Summary: DOM_Range lacks the copy constructor
           Product: Xerces-C++
           Version: 1.6.0
          Platform: Other
        OS/Version: FreeBSD
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: DOM
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The RangeTest program ($XERCESCROOT/tests/DOM/RangeTest) fails under FreeBSD
(at least FreeBSD-4.2r,4.3r and 4.4r). The reason is (to my mind) the following:
1. the test program runs ok until the line #221 of RangeTest.cpp
   ("DOM_Range range = doc.createRange();")
2. here the sequence of actions is the following:
   DOM_Document::createRange
     DocumentImpl::createRange initialize the RangeImpl object and "registers"
                               it within document "ranges collection"
     return DOM_Range(RangeImpl*) creates the DOM_Range wrapper object
and                                         returns it by value, trusting
RefCountedImpl
                                  subsystem (it's ok)
3. DOM_Range range = <DOM_Range, returned by DOM_Document::createRange>
     here the problem lies: the gcc (gcc version 2.95.3 20010315 (release))
     prefers to emply the explicitly defined copy constructor (that lacks the
     RefCountedImpl functionality) over the envocation of the assignment
     operator (explicitly defined for DOM_Range class)

4. As the result, the DOM_Range object, returned by-value, is destroyed ->
   implementation (RangeImpl) object is destructed via reference-counting
   subsystem and the document looses the range object.

I've tried to declare and implement simple copy constructor:

DOM_Range::DOM_Range(const DOM_Range& other)
{
    fImpl = other.fImpl;
    RefCountedImpl::addRef(fImpl);
}

and got positive results (RangeTest runs ok under FreeBSD).

It seems to be more the bug-report on GCC implementation, than on Xerces, but...

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to