Thanks for a quick reply. I included the compilation log in the attachment for clarity. Just in case the compiler is the latest clang from Xcode 9.2.
$ clang --version
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
The code that was added looks like the one below. I don’t think it is valid C++ regardless of the compiler used (and in fact clang 5.0, clang 7.0, gcc 7.0 fail to compile this example as well, and it makes good sense).
While it is a little off the topic, which compiler do you use that has no problems with this code? Perhaps it was dead code previously?
#include
struct A{};
struct B {
const A a{};
void m(B &&other) {
a = std::move(other.a);
}
};
You are right, the latest clang-tools-extra do not trigger the issue (though everything builds without the patch). Thanks.
I guess it is dead code now, yet that std::move is better to be fixed regardless.