Compilation issues

Hello,

May I ask anyone responsible to either fix or revert r326109 and r326110, which effectively broke LLVM compilation with clang?

Str is const now (https://reviews.llvm.org/D43436#C985082NL45), and later on a move constructor on const is performed (https://reviews.llvm.org/D43436#C985082NL64).

Thanks,
Vitaly

Can you be more specific? What version of clang are you using to build LLVM? And what exactly is the error that you’re seeing?

Hi,

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);
}
};

int main() {
B b1, b2;
b2.m(std::move(b1));
}

Best wishes,
Vit

log.txt.zip (29.4 KB)

I’ll fix the bogus std::move. That being said, how up to date is your checkout of clang-tools-extra?

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.

Vit