This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
auto_ptr error is rather confusing
- To: gcc at gcc dot gnu dot org
- Subject: auto_ptr error is rather confusing
- From: Anthony Heading <aheading at jpmorgan dot com>
- Date: Tue, 8 Aug 2000 17:17:15 +0900
Hi,
The following doesn't appear to compile using either 2.95.2 or
CodeSourcery's splendid web snapshot machine (though the
diagnostics are very different).
Yet Sun CC 5 and MSVC 6 both compile it without complaint.
I'm quite prepared to believe that if I were smart enough
to be able to make sense of the X3J16/WG21 documentation,
then it would be clear why I shouldn't expect it to work,
but perhaps then an improved diagnostic or a comment in
some documentation or something would be helpful.
Rgds
Anthony
#include <memory>
int main()
{
std::auto_ptr<int> x;
x = std::auto_ptr<int>(new int);
return 0;
}