On 28.07.2015 21:06, Richard Trieu wrote:
Author: rtrieu
Date: Tue Jul 28 14:06:16 2015
New Revision: 243463

URL: http://llvm.org/viewvc/llvm-project?rev=243463&view=rev
Log:
Do not give a -Wredundant-move warning when removing the move will result in an
error.

If the object being moved has a move constructor and a deleted copy constructor,
std::move is required, otherwise Clang will give a deleted constructor error.

Is that actually correct behavior by Clang? GCC 5.2 compiles the following without problems:

struct A {
    A() {}
    A(A&&) {}
};

struct B {
  B(A) {}
};

B fn(A a) {
    return a;
}

int main() {
    fn(A());
}

Sebastian
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to