This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34666] New: c++0x: non-const method accepted for const&& object.
- From: "pluto at agmk dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jan 2008 00:36:57 -0000
- Subject: [Bug c++/34666] New: c++0x: non-const method accepted for const&& object.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat bug.cpp
template < typename T >
struct X
{
X( X const&& o )
{
o.f(); // <-- accepted.
}
int f();
};
struct Y
{
Y( Y const&& o )
{
o.f(); // <-- rejected.
}
int f();
};
$ /opt/gcc43/bin/g++ bug.cpp -c -std=c++0x
bug.cpp: In constructor 'Y::Y(const Y&&)':
bug.cpp:15: error: passing 'const Y' as 'this' argument of 'int Y::f()'
discards qualifiers
gcc version 4.3.0 20080102
--
Summary: c++0x: non-const method accepted for const&& object.
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pluto at agmk dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34666