This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Is it a bug (gcc 3.4)?


Hi all!
With auto_ptr from gcc 3.4 STL I can't create reference to auto_ptr.

autoptr.cpp:
#include <memory>
using namespace std;

auto_ptr<int> get() { auto_ptr<int> ai(new int); return ai;}
int main()
{	
	const auto_ptr<int>& rai = get(); 

}

Compilation:
/expor...ic_refer$>g++ -c autoptr.cpp
autoptr.cpp: In function `int main()':
autoptr.cpp:7: error: passing `const std::auto_ptr<int>' as `this' argument of `std::auto_ptr<_Tp>::operator std::auto_ptr_ref<_Tp1>() 
[with _Tp1 = int, _Tp = int]' discards qualifiers

Is it a bug?
It used to work with gcc 3.2.
----
Lev Assinovsky
Aelita Software Corporation 
(now is a part of Quest Software)
O&S InTrust Framework Division, Team Leader
ICQ# 165072909


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]