[Bug libstdc++/14528] [3.4/3.5 Regression] trouble with auto_ptr
reichelt at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Mar 12 09:21:00 GMT 2004
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-03-12 09:21 -------
The problem is basically an auto_ptr problem which can be demonstrated
with the following code snippet:
==============================================================================
#include<memory>
typedef const std::auto_ptr<int> A;
void foo(const A&);
A makeA();
void bar()
{
A a; foo(a); // OK
foo(A()); // error
foo(makeA()); // error - the same as in line 45994 of the original example
}
==============================================================================
The problem is, that you need a copy for the temporary (which can be
eliminated, but in theory you need it). With the current implementation
of auto_ptr this is not supplied.
I don't know whether this is correct or a flaw in our auto_ptr
implementation, or even a flaw in the standard. (See PR 14254/3247
for a related issue that came up with stricter checking of the temporary.)
Can a libstdc++ guru provide some insight, please?
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c++ |libstdc++
Summary|[3.4/3.5 Regression] |[3.4/3.5 Regression] trouble
|compiling Boost.Python test |with auto_ptr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14528
More information about the Gcc-bugs
mailing list