public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48289] New: [4.5/4.6/4.7 regression] -pedantic breaks std::move
@ 2011-03-25 15:42 jason at gcc dot gnu.org
  2011-03-25 15:42 ` [Bug c++/48289] " jason at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-25 15:42 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-29 14:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-25 15:42 [Bug c++/48289] New: [4.5/4.6/4.7 regression] -pedantic breaks std::move jason at gcc dot gnu.org
2011-03-25 15:42 ` [Bug c++/48289] " jason at gcc dot gnu.org
2011-03-25 17:04 ` jason at gcc dot gnu.org
2011-03-25 17:54 ` jason at gcc dot gnu.org
2011-03-28 15:58 ` jason at gcc dot gnu.org
2011-03-29 14:38 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).