Bug 690548

Summary: std::move is broken in templates with -pedantic
Product: [Fedora] Fedora Reporter: Serge Pavlovsky <pal666>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: bkoz, jakub, jason
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-25 15:26:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Serge Pavlovsky 2011-03-24 16:07:03 UTC
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 > */

Comment 1 Jason Merrill 2011-03-25 15:21:01 UTC
Added to upstream BZ.