Bug 690548 - std::move is broken in templates with -pedantic
Summary: std::move is broken in templates with -pedantic
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 15
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-24 16:07 UTC by Serge Pavlovsky
Modified: 2011-03-25 15:26 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-25 15:26:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 48289 0 None None None 2019-01-25 18:45:14 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.