This is the mail archive of the gcc-bugs@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]

[Bug c++/48289] New: [4.5/4.6/4.7 regression] -pedantic breaks std::move


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 > */


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