http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48818

           Summary: Wrong copy constructor used when using std::pair in
                    .so and app.
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: melan...@enfocus.com


Created attachment 24142
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24142
Test library and app as illustration of the bug.

Attached is a test application and a shared library it is linked with. If the
wrong copy constructor is used, it will write an error. 

Both the application and the library have a local but different class
"TestObject". Both application and library use a std::pair<TestObject, void*>. 
When the copy constructor of the library's TestObject is called by the
std::pair in the library, the copy constructor from the application's
TestObject is used. This does not happen if the application doesn't have a
std::pair<TestObject, void*>. 

Tested ok with 4.1.3.
Failed with 4.2.1, 4.3.4, 4.4.1, 4.5.1 (I couldn't test it readily with a more
recent version.)

Reply via email to