BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001115 [uClibc++] Other major always 12-13-06 02:03 12-15-06 03:50
Reporter peter_schueller View Status public  
Assigned To gkajmowi
Priority normal Resolution open  
Status feedback   Product Version 0.2.0
Summary 0001115: missing operator= in auto_ptr
Description The operator= I submit in the patch is missing from auto_ptr leading to the following code being incompileable:

typedef std::auto_ptr<Foo> FooPtr;

FooPtr x(bar);
FooPtr y( FooPtr( x ) );
Additional Information patch:

Index: include/memory
===================================================================
--- include/memory (revision 1809)
+++ include/memory (revision 1810)
@@ -148,6 +148,14 @@
                object = p.release();
                return *this;
        }
+ auto_ptr& operator=(auto_ptr_ref<T> p) throw() {
+ if(p.p == object){
+ return *this;
+ }
+ delete object;
+ object = p.p;
+ return *this;
+ }
        ~auto_ptr(){
                delete object;
        }
Attached Files

- Relationships

- Notes
(0001864)
gkajmowi
12-14-06 17:53

I've added a version of your sample code to the memorytest file, and it compiles fine without the modification proposed. If this is an issue, I'd like to fix it, but I'm unable to duplicate the problem.

Please Advise.
 
(0001866)
peter_schueller
12-15-06 03:50

I'm sorry: I used a copy constructor in the testcase and not the missing operator=().

The actual code which does not compile is:

std::auto_ptr<int> myap1;
std::auto_ptr<int> myap2;
myap2 = myap1;

// this did not compile
myap2 = std::auto_ptr<int>(myap1);
 

- Issue History
Date Modified Username Field Change
12-13-06 02:03 peter_schueller New Issue
12-13-06 02:03 peter_schueller Status new => assigned
12-13-06 02:03 peter_schueller Assigned To  => gkajmowi
12-14-06 17:53 gkajmowi Note Added: 0001864
12-14-06 17:53 gkajmowi Status assigned => feedback
12-15-06 03:50 peter_schueller Note Added: 0001866


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker