This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48289] New: [4.5/4.6/4.7 regression] -pedantic breaks std::move
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 25 Mar 2011 15:18:25 +0000
- Subject: [Bug c++/48289] New: [4.5/4.6/4.7 regression] -pedantic breaks std::move
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48289
Summary: [4.5/4.6/4.7 regression] -pedantic breaks std::move
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: c++
AssignedTo: jason@gcc.gnu.org
ReportedBy: jason@gcc.gnu.org
>From https://bugzilla.redhat.com/show_bug.cgi?id=690548
Description of problem:
[18:03:50 pal@underdark ~/tmp/1]$ cat a.cpp
#include <utility>
class A { };
static void g ( A && ) { }
template < class T > class B {
public:
void f ( ) {
A a;
g ( std :: move ( a ) );
}
};
=================
[18:04:13 pal@underdark ~/tmp/1]$ LANG=C g++ -std=c++0x -pedantic -c a.cpp
a.cpp: In member function 'void B<T>::f()':
a.cpp:11:25: error: invalid initialization of reference of type 'A&&' from
expression of type 'std::remove_reference<A&>::type'
a.cpp:5:13: error: in passing argument 1 of 'void g(A&&)'
=================
error can be fixed by removing -pedantic or by commenting out /*template <
class T > */