[Bug c++/70647] Feature request: warning for self-moving in constructors

2016-04-14 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70647 --- Comment #4 from Matt Godbolt --- Agreed re: cast/FE. I couldn't quite get your example to fail as the "o" parameter is unusued (which would be a good clue! #include // for std::move struct B { int a; int b; B(B &) : a(b),

[Bug c++/70647] Feature request: warning for self-moving in constructors

2016-04-14 Thread lopezibanez at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70647 --- Comment #3 from Manuel López-Ibáñez --- > --- Comment #2 from Matt Godbolt --- > Thanks Manuel. Interestingly this does elicit a warning: > > struct B { > int a; int b; > B(B &) > : a(static_cast(a)), > b(std::move(o.b)) {} >

[Bug c++/70647] Feature request: warning for self-moving in constructors

2016-04-14 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70647 --- Comment #2 from Matt Godbolt --- Thanks Manuel. Interestingly this does elicit a warning: struct B { int a; int b; B(B &) : a(static_cast(a)), b(std::move(o.b)) {} }; but this does not: struct B { int a; int b; B(B

[Bug c++/70647] Feature request: warning for self-moving in constructors

2016-04-13 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70647 Manuel López-Ibáñez changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC|