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=20642>.
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=20642

Lack of ctor definitions in XMemory prevents build on VC++ 7.0 with WPO enabled

           Summary: Lack of ctor definitions in XMemory prevents build on
                    VC++ 7.0 with WPO enabled
           Product: Xerces-C++
           Version: 2.3.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Utilities
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


In XMemory.hpp two constructors (copy and assignment) have been marked as 
private/unimplemented:

    // -----------------------------------------------------------------------
    //  Unimplemented constructors and operators
    // -----------------------------------------------------------------------
    XMemory(const XMemory&);
    XMemory& operator=(const XMemory&);

No definition can be found in the corresponding CPP file. Most compilers will (and 
should) probably not care, since these constructors will never be used. Nevertheless, 
the lack of a definition causes VC++ 7.0 to emit a linker error when its Whole Program 
Optimization feature, WPO, is enabled (and I want to use WPO to achieve optimal 
performance).

The error can be resolved by providing a dummy inline definition in the header file 
(or perhaps in the implementation file), like this:

XMemory(const XMemory&) { /* Not implemented */ }
XMemory& operator=(const XMemory&) { /* Not implemented */ return *this; }

You might want to add an "assert(false);" in both methods in order to make sure any 
accidental use will not go undetected.

Cheers!

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

Reply via email to